IsMultisetElementWithCount extends TypeSafeMatcher<Multiset<E>> { public static <E> Matcher<Multiset<E>> elementWithCount(final E element, final int size) { return new IsMultisetElementWithCount(element, 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 testGivenThatSizeIsNegativeWhenCreateInstanceThenNullPointerExceptionIsThrown() throws Exception { thrown.expect(IllegalArgumentException.class); final int negativeSize = -1; assumeThat(negativeSize, lessThan(0)); IsMultisetElementWithCount.elementWithCount(comparison, -1); fail("IllegalArgumentException comparison"); }