chapter4 java freelance pattern