1、lambda表达式字符串去重
List<String> dataList = list.stream().distinct().collect(Collectors.toList());
2、lambda表达式对象去重
// 根据身份证号去重
personList = personList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(
// 利用 TreeSet 的排序去重构造函数来达到去重元素的目的
// 根据certNo去重
() -> new TreeSet<>(Comparator.comparing(Person::getCertNo))), ArrayList::new));
3、lambda表达式升序
xxxList.sort(Comparator.comparingInt(xxx::getNum));