Functions { @SuppressWarnings("unchecked") public static <T> UnaryOperator<T> identity() { return (UnaryOperator<T>) IDENTITY; }  @SuppressWarnings("unchecked") static UnaryOperator<T> identity(); @SuppressWarnings("unchecked") static Function<T,Integer> zero(); static Function<T,Integer> unpartitioned(); static void closeFunction(Object function); static Function<T,R> synchronizedFunction(final Function<T,R> function); static Supplier<T> synchronizedSupplier(final Supplier<T> function); static Consumer<T> synchronizedConsumer(final Consumer<T> function); static BiFunction<T,U,R> synchronizedBiFunction(final BiFunction<T,U,R> function); static boolean isImmutable(Object function); static boolean isImmutableClass(Class<?> clazz); static Runnable delayedConsume(Consumer<T> consumer, T value); static Runnable runWithFinal(Runnable action, Runnable finalAction); @SuppressWarnings("unchecked") static Consumer<T> discard(); @SuppressWarnings("unchecked") static Predicate<T> alwaysTrue(); @SuppressWarnings("unchecked") static Predicate<T> alwaysFalse();  }
@Test public void testIdentity() { String s = "hello"; assertSame(s, identity().apply(s)); Integer i = 42; assertSame(i, identity().apply(i)); Object o = new Object(); assertSame(o, identity().apply(o)); }