@Test public void filterDuplicatesWhenNull() { assertTrue(UserUtil.filterDuplicates(null).collect(Collectors.toList()).isEmpty()); }
public static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers) { if (externalUsers == null) { return Stream.empty(); } else { final Set<String> included = new HashSet<>(); return externalUsers.stream() .filter(Objects::nonNull) .filter(externalUser -> { if (!included.contains(externalUser.getId())) { included.add(externalUser.getId()); return true; } return false; }); } }
UserUtil { public static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers) { if (externalUsers == null) { return Stream.empty(); } else { final Set<String> included = new HashSet<>(); return externalUsers.stream() .filter(Objects::nonNull) .filter(externalUser -> { if (!included.contains(externalUser.getId())) { included.add(externalUser.getId()); return true; } return false; }); } } }
UserUtil { public static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers) { if (externalUsers == null) { return Stream.empty(); } else { final Set<String> included = new HashSet<>(); return externalUsers.stream() .filter(Objects::nonNull) .filter(externalUser -> { if (!included.contains(externalUser.getId())) { included.add(externalUser.getId()); return true; } return false; }); } } private  UserUtil(); }
UserUtil { public static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers) { if (externalUsers == null) { return Stream.empty(); } else { final Set<String> included = new HashSet<>(); return externalUsers.stream() .filter(Objects::nonNull) .filter(externalUser -> { if (!included.contains(externalUser.getId())) { included.add(externalUser.getId()); return true; } return false; }); } } private  UserUtil(); static User fromExternalUser(org.kie.server.services.taskassigning.user.system.api.User externalUser); static boolean isUser(String userType); static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers); }
UserUtil { public static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers) { if (externalUsers == null) { return Stream.empty(); } else { final Set<String> included = new HashSet<>(); return externalUsers.stream() .filter(Objects::nonNull) .filter(externalUser -> { if (!included.contains(externalUser.getId())) { included.add(externalUser.getId()); return true; } return false; }); } } private  UserUtil(); static User fromExternalUser(org.kie.server.services.taskassigning.user.system.api.User externalUser); static boolean isUser(String userType); static Stream<org.kie.server.services.taskassigning.user.system.api.User> filterDuplicates(Collection<org.kie.server.services.taskassigning.user.system.api.User> externalUsers);  }