Example code from Head First Design Pattern