Various design pattern examples in java