I wrote palindrome function in Java using Recursion but its printing the results incorrectly.

```
public static boolean isPalindrome(String test) {
        if(test.length() == 1 || test.equals("")) {
            System.out.println("Length is one");
            return true;

        } 

        if (test.charAt(0) == test.charAt(test.length() - 1)) {
            System.out.println("Length is one 111 a");
            isPalindrome(test.substring(1,test.length() -1)) ;      
        } 
        System.out.println("Length is one 111");
        return false;
    }

    public static void main(String args[]) {
        if(isPalindrome("rotor"))
            System.out.println(" Rotor is a palindrome");
        else
            System.out.println(" Rotor is not a palindrome");
        //System.out.println(isPalindrome("rotor"));
        //System.out.println(isPalindrome("motor"));
        //System.out.println(isPalindrome("a"));

    }

```

Output:

```
Length is one 111 a
Length is one 111 a
Length is one
Length is one 111
Length is one 111
 Rotor is not a palindrome

```