IsMultimapWithKeySetSize extends TypeSafeMatcher<Multimap<K, ?>> { public static <K> Matcher<Multimap<K, ?>> keySetWithSize(final int size) { return new IsMultimapWithKeySetSize(size); } IsMultimapWithKeySetSize(final int size); static Matcher<Multimap<K, ?>> emptyKeySet(); static Matcher<Multimap<K, ?>> keySetWithSize(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 testGivenThatSizeIsNegativeWhenCreateInstanceThenNullPointerExceptionIsThrown() throws Exception { thrown.expect(IllegalArgumentException.class); final int negativeSize = -1; assumeThat(negativeSize, lessThan(0)); IsMultimapWithKeySetSize.keySetWithSize(-1); fail("IllegalArgumentException comparison"); }