Use take(n) instead of subList(0, n)

Proprietary

take(n) returns the first n elements as a stable copy. subList(0, n) returns a live view backed by the original list — surprising aliasing if the source is mutated.

org.openrewrite.kotlin.stdlib.UseTakeForSubListFromZero$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.stdlib.UseTakeForSubListFromZero$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.