Design patterns examples implemented in Java