I have two list
List<Map<String,Object>> list1 = new ArrayList<>();
List<Map<String,Object>> list2 = new ArrayList<>();
The list is a list of maps with each map like below
name-> XXX
age->yyy
id->zzz
Now I want to combine these into a single list and also removing duplicates based on the id of the map.
Im using the below to combine the list but not sure how to remove duplicates based on a value of the map
List<Map<String,Object>> newList = Stream.concat(list1.stream(), list2.stream()).collect(Collectors.toList());