I have one Map
Map<Long, List<Set<Long>>> map1; Example: Map<City_Id, List<Set<Subtier_Cities_ids>>>
There is Another Map `
Map<Long, Set<Long>> map2; Example: Map<Subtier_Cities_ids,Set<Villages_ids>>`
I want to compare the values of map1 (Second value in the list) and the keys of map2 and bring new map
Map<Long, Set<Long>> map3; Example: Map<City_Id, Set<Villages_ids>>
You can achieve this by iterating over the entry of map1 and then iterating over the list of Sets. If I understood correctly code should look like this: