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
I favor using Guava ImmutableMap. They support Map.equals() and are easy to construct. The only trick is to explicitly specify type parameters, since hamcrest will assume the ImmutableMap type.
Map.equals()
ImmutableMap
assertThat( actualValue, Matchers.>equalTo( ImmutableMap.of( "key1", "value", "key2", "other-value" ) ) );