IsMultimapWithKeySet extends TypeSafeMatcher<Multimap<K, ?>> { public static <K> Matcher<Multimap<K, ?>> hasSameKeySet(final Multimap<K, ?> comparison) { return hasSameKeySet(comparison.keySet()); } IsMultimapWithKeySet(final Set<K> comparisonSet); static Matcher<Multimap<K, ?>> hasSameKeySet(final Multimap<K, ?> comparison); static Matcher<Multimap<K, ?>> hasSameKeySet(final Set<K> comparison); @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 testGivenThatMultimapIsNullWhenCreateInstanceThenNullPointerExceptionIsThrown() throws Exception { thrown.expect(NullPointerException.class); IsMultimapWithKeySet.hasSameKeySet((Multimap) null); fail("NullPointerException comparison"); }
@Test public void testGivenThatSetIsNullWhenCreateInstanceThenNullPointerExceptionIsThrown() throws Exception { thrown.expect(NullPointerException.class); IsMultimapWithKeySet.hasSameKeySet((Set) null); fail("NullPointerException comparison"); }