Various design patterns implemented in Java