Utility Class to bootstrap lambda expressions or method references for method chaining?
问题 With the functional interfaces introduced in Java 8, you can easily chain different expressions into one new expression, illustrated by the code snippet below. public class PredicateChaining { public static void main(String[] args) { // verbose, but standard JDK functionality only Predicate<String> allUpperCase = StringUtils::isAllUpperCase; Predicate<String> longerThan5 = s -> s.length() > 5; if (allUpperCase.and(longerThan5).test("PREDICATE")) { System.out.println("'PREDICATE' is a