Replace filter then size with count
ProprietaryReplaces .filter(f).size or .filter(f).length chains with .count(f) to avoid creating an unnecessary intermediate collection.
org. openrewrite. scala. performance. UseCountmod run . --recipe= org. openrewrite. scala. performance. UseCountInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.