diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java index 46905a841..ede68aa07 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java @@ -546,6 +546,14 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes test.put((K) "key", (V) "object0"); test.putAll(original); + try { + final MultiValuedMap originalNull = null; + test.putAll(originalNull); + fail("expecting NullPointerException"); + } catch (final NullPointerException npe) { + // expected + } + assertEquals(2, test.keySet().size()); assertEquals(4, test.size()); assertEquals(1, test.get((K) "keyA").size()); @@ -570,6 +578,14 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes test.put((K) "keyX", (V) "object0"); test.putAll(original); + try { + final Map originalNull = null; + test.putAll(originalNull); + fail("expecting NullPointerException"); + } catch (final NullPointerException npe) { + // expected + } + assertEquals(3, test.keySet().size()); assertEquals(4, test.size()); assertEquals(1, test.get((K) "keyA").size());