Use ListUtils.filter instead of mapping elements to null
MSALReplaces ListUtils.map(list, e -> condition ? null : e) and the equivalent block lambdas with ListUtils.filter(list, e -> !condition), which states the intent of removing elements directly.
org. openrewrite. java. recipes. ListUtilsFilterOverMapToNullmod run . --recipe= org. openrewrite. java. recipes. ListUtilsFilterOverMapToNullInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.