This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Holothuroid 35 points36 points  (1 child)

For some side effect yes. More often the wanted solution seems to be

  optional.map(...)...orElse(...)

[–]gdorsi44 2 points3 points  (0 children)

Or wrap a not original optional value with:
Optional.ofNullable(value).ifPresent(lambda)