jdk8对map集合数据进行去重操作
List<Map<String, String>> list = new ArrayList<>(16) ;
Map<String,String> map1 = new HashMap<>(16);
map1.put("key1", "val1");
Map<String,String> map2 = new HashMap<>(16);
map2.put("key1", "val1");
list.add(map1);
list.add(map2);
list.forEach(System.out::println);
ArrayList<Map<String, String>> data = list.stream().collect(
Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(m -> m.get("key1")))), ArrayList::new));
System.out.println("=======去重前后分界线=======");
data.forEach(System.out::println)