Use lambda expressions instead of anonymous classes

MSAL

Instead of anonymous class declarations, use a lambda where possible. Using lambdas to replace anonymous classes can lead to more expressive and maintainable code, improve code readability, reduce code duplication, and achieve better performance in some cases.

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

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