Prefer Predicate.not(..) over casting to Predicate and calling negate()

MSAL

Replace ((Predicate<T>) lambdaOrMethodRef).negate() with Predicate.not(lambdaOrMethodRef) as of Java 11.

org.openrewrite.java.migrate.util.UsePredicateNot
mod run . --recipe=org.openrewrite.java.migrate.util.UsePredicateNot

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.