I am trying to compare 2 Maps (Map<String, ArrayList<String>>) using MapDifference<K,V> from the Guava utility library. Objective is to compare both Maps and place all keys/values that are unique Map One within a new Map and the same for Map 2. Note. Both Maps are likely to have same keys with different values.
The output from code below:
You can see from the line above that the output shows both Maps have the same Key (KeyOne) with different values (with the exception of "One"). I'd like to create two new Maps to hold these values (1 for Map A and 1 for Map B). Where there is a common value such as the value "one" , it will be stored in map A only. Problem is the line diff.enteries is unmodifiable expression, I am not sure how to extract its values to save within a collection/map.
The output from code below:
You can see from the line above that the output shows both Maps have the same Key (KeyOne) with different values (with the exception of "One"). I'd like to create two new Maps to hold these values (1 for Map A and 1 for Map B). Where there is a common value such as the value "one" , it will be stored in map A only. Problem is the line diff.enteries is unmodifiable expression, I am not sure how to extract its values to save within a collection/map.