Functions { @SuppressWarnings("unchecked") public static <T> Predicate<T> alwaysTrue() { return (Predicate<T>) TRUE; }  @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 testAlwaysTrue() { assertTrue(Functions.alwaysTrue().test("hello")); assertTrue(Functions.alwaysTrue().test(42)); assertTrue(Functions.alwaysTrue().test(new Object())); }