How to detect a palindrome in Java