Prefer JDK methods for Maps and Sets of an expected size
MSALReplace Guava's Maps.newHashMapWithExpectedSize(int), Maps.newLinkedHashMapWithExpectedSize(int), Sets.newHashSetWithExpectedSize(int) and Sets.newLinkedHashSetWithExpectedSize(int) with the Java 19 HashMap.newHashMap(int), LinkedHashMap.newLinkedHashMap(int), HashSet.newHashSet(int) and LinkedHashSet.newLinkedHashSet(int), which size the collection for the expected number of elements as Guava does.
org. openrewrite. java. migrate. guava. NoMapsAndSetsWithExpectedSizemod run . --recipe= org. openrewrite. java. migrate. guava. NoMapsAndSetsWithExpectedSizeInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.