examples about design parterns in java