Examples of design patterns in java