add classic recursion java solution for problem 2