P06 { public static <T> boolean isPalindrome(List<T> list) { List<T> original = new ArrayList<>(list); P05.reverse(list); return Objects.equals(list, original); }  static boolean isPalindrome(List<T> list); static boolean isPalindrome_IntStream(List<T> list);  }
@Test public void shouldReturnTrueWhenListIsPalindrome() throws Exception { assertTrue(isPalindrome(Arrays.asList("x", "a", "m", "a", "x"))); }
@Test public void shouldReturnFalseWhenListIsNotPalindrome() throws Exception { assertFalse(isPalindrome(Arrays.asList(1, 2, 3, 4, 5))); }
@Test public void shouldReturnTrueWhenListIsPalindrome_IntStream() throws Exception { assertTrue(isPalindrome(Arrays.asList("x", "a", "m", "a", "x"))); }
@Test public void shouldReturnFalseWhenListIsNotPalindrome_IntStream() throws Exception { assertFalse(isPalindrome(Arrays.asList(1, 2, 3, 4, 5))); }