Various design patterns on Java