daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void printCapitalizedPermissionNamesOfUsersWithSurnameStartingWithS(List<User> users) {
  2.         users.stream()
  3.                 .filter(user -> user.getPersonDetails().getSurname().startsWith("S"))
  4.                 .flatMap(user -> user.getPersonDetails().getRole().getPermissions().stream())
  5.                 .map(permission -> permission.getName().toUpperCase())
  6.                 .forEach(System.out::println);
  7.     }
RAW Paste Data
Top