Replace .head with .headOption

Proprietary

Replaces .head calls on collections with .headOption to avoid NoSuchElementException on empty collections.

org.openrewrite.scala.performance.UseHeadOption
mod run . --recipe=org.openrewrite.scala.performance.UseHeadOption

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