public static <U> Predicate<U> isEqualsTo(U u) {
return s -> s.equals(u);
/*Predicate<U> return type
U u is the parameter
s-> s.equals(u) is the lambda expression */
}
Run Code Online (Sandbox Code Playgroud)
什么是第一<U>前Predicate<U>是什么意思?