Java Iterator Explained with Palindrome Example