Use Collection#isEmpty() instead of comparing size()

MSAL

Replaces comparisons of size() to zero with isEmpty(), or with !isEmpty() when testing for a non-zero size. Using isEmpty() communicates intent more clearly than comparing size() to zero, and for some collection implementations isEmpty() can be more efficient since size() may require traversal.

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

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