I am comparing two maps (called map1 and map2) using the Google guava API method below:
System.out.println(Maps.difference(map1, map2));
I get "equal" or "not equal" results back from the method along with the description of differences (in the case of "not equal" of course). I would like to modify the output and print out only the "not equal" elements/values.
I had a look at the API...The method Maps.difference(map1, map2) returns a MapDifference<K,V>. I thought of using the entriesDiffering()method of the MapDifference<K,V> interface but - according to the documentation - that only returns Map<K,MapDifference.ValueDifference<V>> which is a key followed by the values of 2 different maps that correspond to that key.
Please let me know if my explanation is hard to follow and I will try to reword it.
Thanks.