Gang Of four design patterns implemented in Java