Example code of java recursion