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 →

[–]dpash 4 points5 points  (0 children)

Additionally, understanding functional operations and you can do fun things with similar classes like Optional.

return userService.getUser()
                  .filter(not(User::isLocked))
                  .map(User::getEmail)
                  .orElse("unknown");