lamada表达式只支持一个字段的去重,针对于多个字段的去重,我们可以进行拼接去重
List<Map<String, String>> arrayList = list.stream().
collect(Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(o -> o.get(“name”) + “:” + o.get(“address”) + “:” + o.get(“sex”)))), ArrayList::new));