Use distinct() instead of toHashSet().toList()
ProprietaryRound-tripping through a HashSet to drop duplicates obscures intent and allocates an intermediate. distinct() says what it does and returns a List directly.
org. openrewrite. kotlin. stdlib. UseDistinctForToHashSetToList$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. stdlib. UseDistinctForToHashSetToList$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.