IsMultimapKeyWithCollectionSize extends TypeSafeMatcher<Multimap<K, ?>> { @Override public void describeTo(final Description description) { description.appendText("a Multimap with element ").appendValue(comparison).appendText(" with collection size ") .appendValue(size); } IsMultimapKeyWithCollectionSize(final K comparison, final int size); static Matcher<Multimap<K, ?>> keyWithSize(final K element, final int size); @Override boolean matchesSafely(final Multimap<K, ?> actual); @Override void describeMismatchSafely(final Multimap<K, ?> multimap, final Description mismatchDescription); @Override void describeTo(final Description description);  }
@Test public void testDescribeTo() throws Exception { BaseMatcherTest.assertIsDescribedTo(String.format("a Multimap with element \"%s\" with collection size <%d>", comparison, expectedSizeCollectionForKeyInGeneralMatcher), isMultimapElementWithCollectionSizeMatcher); }