// "Remove redundant steps from optional chain" "true" import java.util.Optional; public class Test { public Optional test() { return getOpt().map(Optional::of).orElse(Optional.empty()); } private Optional getOpt() { return Optional.of("foo"); } }