add Solution 1-5 in Java