problem 22 java