Implementations of various design patterns in Java