Replace CollectionUtils.cardinality with IterableUtils.frequency

MSAL

Replace attributed Java invocations of Commons Collections 4 cardinality when IterableUtils is present on the source set classpath (Commons Collections 4.1 or later). Preserve null iterable rejection with Objects.requireNonNull, requiring Java 7 or later. Only local variables, parameters and literals with a class qualifier or static import are migrated. Other argument expressions, expression qualifiers, explicit type arguments and method references are retained to preserve evaluation and typing.

org.openrewrite.apache.commons.collections.CollectionUtilsCardinalityToFrequency
mod run . --recipe=org.openrewrite.apache.commons.collections.CollectionUtilsCardinalityToFrequency

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