IsMultisetElementWithCount extends TypeSafeMatcher<Multiset<E>> { @Override public void describeTo(final Description description) { description.appendText("a Multiset with element ").appendValue(comparison).appendText(" with count ") .appendValue(size); } IsMultisetElementWithCount(final E comparison, final int size); static Matcher<Multiset<E>> elementWithCount(final E element, final int size); @Override boolean matchesSafely(final Multiset<E> actual); @Override void describeMismatchSafely(final Multiset<E> multiset, final Description mismatchDescription); @Override void describeTo(final Description description);  }
@Test public void testDescribeTo() throws Exception { BaseMatcherTest.assertIsDescribedTo(String.format("a Multiset with element \"%s\" with count <%d>", comparison, expectedCountGeneralMatcher), isMultisetElementWithCountMatcher); }