Prefer Set.of(..) in Java 9 or higher

MSAL

Replaces .common.collect.ImmutableSet.of(..) if the returned type is immediately down-cast. Two or more elements convert only when they are distinct literals or enum constants, since Set.of rejects duplicates.

org.openrewrite.java.migrate.guava.NoGuavaImmutableSetOf
mod run . --recipe=org.openrewrite.java.migrate.guava.NoGuavaImmutableSetOf

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