package com.google.common.base; import typeUse.*; interface Function extends java.util.function.Function { @Override @javax.annotation.Nullable T apply(@javax.annotation.Nullable F input); } interface Predicate extends java.util.function.Predicate { boolean apply(@javax.annotation.Nullable T input); default boolean test(@javax.annotation.Nullable T input) { return apply(input); } } class Test { void test(Predicate pred) { pred.apply(null); } void testNullable(Predicate<@Nullable String> pred) { pred.apply(null); } void testNotNull(Predicate<@NotNull String> pred) { pred.apply(null); } void apply(Function fn) { fn.apply(null).hashCode(); } void applyNullable(Function<@Nullable String, @Nullable String> fn) { fn.apply(null).hashCode(); } void applyNotNull(Function<@NotNull String, @NotNull String> fn) { fn.apply(null).hashCode(); } void call() { test(x -> x.hashCode() > 0); testNullable(x -> x.hashCode() > 0); testNotNull(x -> x.hashCode() > 0); apply(x -> x.trim()); applyNullable(x -> x.trim()); applyNotNull(x -> x.trim()); } }