Replace filter(Optional::isPresent).map(Optional::get) with flatMap(Optional::stream)
MSALReplace Stream<Optional>.filter(Optional::isPresent).map(Optional::get) with .flatMap(Optional::stream) in Java 9 or higher.
org. openrewrite. java. migrate. util. OptionalStreamRecipemod run . --recipe= org. openrewrite. java. migrate. util. OptionalStreamRecipeInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.