Functions { public static <T> Function<List<T>, T> lastOfList() { return list -> list.get(list.size() - 1); } private  Functions(); static Function<List<T>, T> firstOfList(); static Function<List<T>, T> lastOfList(); static Function<List<T>, T> nthOfList(int index); static Function<List<T>, List<T>> permutationOfList(
      int... indexes); static Function<List<T>, List<T>> withoutSeparators(); static Function<Object, T> constant(T output);  }
@Test public void testLastOfList() { assertEquals('a', lastOfList().apply(ONE)); assertEquals('b', lastOfList().apply(TWO)); assertEquals('c', lastOfList().apply(THREE)); }