Design patterns examples in Java