HeadFirstDesignPattern practice