Palindrome { public Deque<Character> wordToDeque(String word) { Deque<Character> deque = new LinkedListDeque<Character>(); for(int i = 0; i < word.length(); i++) { deque.addLast(word.charAt(i)); } return deque; }  Deque<Character> wordToDeque(String word); boolean isPalindrome(String word); boolean isPalindrome(String word, CharacterComparator cc);  }
@Test public void testWordToDeque() { Deque d = palindrome.wordToDeque("persiflage"); String actual = ""; for (int i = 0; i < "persiflage".length(); i++) { actual += d.removeFirst(); } assertEquals("persiflage", actual); }