List<Map<Object,Object>> list = new ArrayList();
Map<Object,Object> map = new HashMap<>();
map.put("s",1);
list.add(map);
Map<Object,Object> map2 = new HashMap<>();
map2.put("s",2);
list.add(map2);
Map<Object,Object> map3 = new HashMap<>();
map3.put("s",1);
list.add(map3);
System.out.println(list);
Map<Object,Object> map4= new HashMap<>();
HashSet hashSet = new HashSet();
//去重 因为map没有get属性方法 所以换一种
//list.stream().distinct(s::getName()).(Collectors.toList()); //这种为list里面是对象得时候
List list1 = list.stream().filter(i -> map4.putIfAbsent(i.get("s"), Boolean.TRUE) == null).collect(Collectors.toList());
//或者用hashset
//List list1 = list.stream().filter(i -> hashSet.add(i)).collect(Collectors.toList());
System.out.println(list1);