+fun <K, V> isEmptyMap() = object : TypeSafeDiagnosingMatcher<Map<K, V>>() {
+ override fun describeTo(description: Description) {
+ description.appendText("empty map")
+ }
+
+ override fun matchesSafely(item: Map<K, V>, mismatchDescription: Description) =
+ item.isEmpty().onFalse {
+ mismatchDescription.appendText("was ").appendValue(item)
+ }
+}
+