Different design patterns examples in Java