Use Collection#isEmpty() instead of comparing size()
MSALReplaces 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. IsEmptyCallOnCollectionsmod run . --recipe= org. openrewrite. staticanalysis. IsEmptyCallOnCollectionsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.