Class PredicateNotExamples
java.lang.Object
net.jrodolfo.java_evolution.java11.PredicateNotExamples
Demonstrates
Predicate.not(Predicate), introduced in Java 11.
Before Java 11, negating a predicate in a stream often required a lambda such
as value -> !value.isBlank(). That prevented using a direct method
reference for the positive condition.
Predicate.not(Predicate) solves this by adapting an existing
predicate or method reference into its opposite, keeping stream filters easy
to scan.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnonBlankValues(List<String> values) Removes blank strings withPredicate.not(String::isBlank).
-
Constructor Details
-
PredicateNotExamples
public PredicateNotExamples()
-
-
Method Details
-
nonBlankValues
-