I\'d like to use hamcrest to assert that two maps are equal, i.e. they have the same set of keys pointing to the same values.
My current best guess is:
a
Another option available now is to use the Cirneco extension for Hamcrest. It has hasSameKeySet() (as well as other matchers for Guava "collections"). According to your example, it will be:
assertThat(affA, hasSameKeySet(affB));
You can use the following dependency for a JDK7-based project:
it.ozimov
java7-hamcrest-matchers
0.7.0
or the following if you are using JDK8 or superior:
it.ozimov
java8-hamcrest-matchers
0.7.0