LongestPalindrome { public int lenOfLongest(char[] cs) { if (cs.length <= 1) { return cs.length; } char[] oddCs = new char[2 * cs.length + 1]; oddCs[0] = '$'; for (int i = 0; i < cs.length; i++) { oddCs[2 * i + 1] = cs[i]; oddCs[2 * i + 2] = '$'; } return IntStream.of(plenWithOddArray(oddCs)).max().getAsInt() / 2; }  int lenOfLongest(char[] cs);  }
@Test(dataProvider = "palindromeObjects") public void test(String string, int expectedLen) { assertEquals(new LongestPalindrome().lenOfLongest(string.toCharArray()), expectedLen); }