一、去除List中重复的String
List uniqueStr = list.stream().distinct().collect(Collectors.toList());
二、按对象属性去重
users = users.stream().collect(
collectingAndThen(
toCollection(() -> new TreeSet<>(Comparator.comparing(UserInDeptDto::getUserId))), ArrayList::new) );