### Question:
Palindrome { public boolean isPalindrome(String word) { Deque<Character> worddeque = wordToDeque(word); if (worddeque.size() == 0 || worddeque.size() == 1) { return true; } else { if (worddeque.removeFirst() == worddeque.removeLast()) { return isPalindrome(DequeToString(worddeque)); } else { return false; } } }  Deque<Character> wordToDeque(String word); boolean isPalindrome(String word); boolean isPalindrome(String word, CharacterComparator cc);  }### Answer:
@Test public void TestPalindromeOffByOne1() { CharacterComparator cc = new OffByOne(); assertTrue(palindrome.isPalindrome("a", cc)); }
@Test public void TestPalindromeOffByOne2() { CharacterComparator cc = new OffByOne(); assertFalse(palindrome.isPalindrome("AcA", cc)); }
@Test public void TestPalindromeOffByOne3() { CharacterComparator cc = new OffByOne(); assertTrue(palindrome.isPalindrome("AcdB", cc)); }
@Test public void TestPalindromeOffByOne4() { CharacterComparator cc = new OffByOne(); assertFalse(palindrome.isPalindrome("stttt", cc)); }
@Test public void TestPalindromeOffByN1() { CharacterComparator cc = new OffByN(5); assertTrue(palindrome.isPalindrome("a", cc)); }
@Test public void TestPalindromeOffByN2() { CharacterComparator cc = new OffByN(5); assertTrue(palindrome.isPalindrome("acf", cc)); }
@Test public void TestPalindromeOffByN3() { CharacterComparator cc = new OffByN(5); assertTrue(palindrome.isPalindrome("AhcF", cc)); }
@Test public void TestPalindromeOffByN4() { CharacterComparator cc = new OffByN(5); assertFalse(palindrome.isPalindrome("stttt", cc)); }
@Test public void TestPalindrome1() { assertTrue(palindrome.isPalindrome("a")); }
@Test public void TestPalindrome2() { assertTrue(palindrome.isPalindrome("AcA")); }
@Test public void TestPalindrome3() { assertFalse(palindrome.isPalindrome("Aca")); }
@Test public void TestPalindrome4() { assertTrue(palindrome.isPalindrome("sttts")); }