Skip to content

Instantly share code, notes, and snippets.

@zivce
Created April 17, 2021 13:24
Show Gist options
  • Save zivce/a97b2d76d6f7b9a09d17d078a8a0c32f to your computer and use it in GitHub Desktop.
Save zivce/a97b2d76d6f7b9a09d17d078a8a0c32f to your computer and use it in GitHub Desktop.
opt.<Runnable>map(value -> () -> System.out.println("Found " + value))
.orElse(() -> System.out.println("Not present!"))
.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment