Use the diamond operator

MSAL

The diamond operator (<>) should be used. Java 7 introduced the diamond operator to reduce the verbosity of generics code. For instance, instead of having to declare a List's type in both its declaration and its constructor, you can now simplify the constructor declaration with <>, and the compiler will infer the type. Repeating type arguments that the compiler can already deduce is unnecessary boilerplate that clutters the code.

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

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