@ CanIgnoreReturnValue public Ordered containsExactlyEntriesIn ( Map < ? , ? > expectedMap ) { if ( expectedMap . isEmpty ( ) ) { if ( actual ( ) . isEmpty ( ) ) { return IN_ORDER ; } else { isEmpty ( ) ; // fails return ALREADY_FAILED ; } } boolean containsAnyOrder = containsEntriesInAnyOrder ( expectedMap , "contains exactly" , /* allowUnexpected= */ false ) ; if ( containsAnyOrder ) { return new MapInOrder ( expectedMap , "contains exactly these entries in order" ) ; } else { return ALREADY_FAILED ; } }
Fails if the map does not contain exactly the given set of entries in the given map .