EPI Chapter 7 java solution