Head First Design Pattern practice