Use method references in lambda

MSAL

Replaces the single statement lambdas o -> o instanceof X, o -> (A) o, o -> System.out.println(o), o -> o != null, o -> o == null with the equivalent method reference. Method references are often more concise and readable than their lambda equivalents, making the code's intent clearer at a glance.

org.openrewrite.staticanalysis.ReplaceLambdaWithMethodReference
mod run . --recipe=org.openrewrite.staticanalysis.ReplaceLambdaWithMethodReference

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