list集合通过用户名唯一去重
重复数据的集合
List<UserDTO> userList = new ArrayList<>();
// 去重
List<UserDTO> userList1 = userList.stream().collect(Collectors .collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(UserDTO::getUserName))), ArrayList::new));
/**
* 用户账号
*/
private String userName;