Type a Predicate that tests if a String is longer than five chars
Type a Predicate that tests if a String is longer than five chars
Answer
Predicate<String> long5 = s -> s.length() > 5;
Predicate<T> has one abstract method: boolean test(T t). It is the natural type for filter conditions.