exercise for ThinkingInJava