Skip to content

Instantly share code, notes, and snippets.

@ashkrit
Created March 14, 2020 03:18
Show Gist options
  • Save ashkrit/7decde30bcdad1b4e1ae8095ec6bed71 to your computer and use it in GitHub Desktop.
Save ashkrit/7decde30bcdad1b4e1ae8095ec6bed71 to your computer and use it in GitHub Desktop.
Optional<String> phone = contactNumber(p);
Optional<String> email = email(p);
if (phone.isPresent()) {
System.out.println("Calling Phone " + phone.get());
}
if (email.isPresent()) {
System.out.println("Sending Email " + email.get());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment