Find Java-style iterable.forEach(Consumer) calls

Proprietary

Iterable.forEach(Consumer<T>) is the Java-8 functional terminal; Kotlin source can use the same shape but the inline kotlin.collections.forEach is preferred — it doesn't allocate a Consumer and integrates with non-local return/break inside the lambda.

org.openrewrite.kotlin.interop.FindIterableForEach$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.interop.FindIterableForEach$KtRecipe'

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