diff --git a/src/test/java/org/apache/commons/collections4/MultiSetUtilsTest.java b/src/test/java/org/apache/commons/collections4/MultiSetUtilsTest.java index 787753801..fb66cde2b 100644 --- a/src/test/java/org/apache/commons/collections4/MultiSetUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/MultiSetUtilsTest.java @@ -55,7 +55,7 @@ public class MultiSetUtilsTest { } catch (UnsupportedOperationException e) { } } - + /** * Tests {@link MultiSetUtils#unmodifiableMultiSet(org.apache.commons.collections4.MultiSet) ()}. */ @@ -63,30 +63,30 @@ public class MultiSetUtilsTest { public void testUnmodifiableMultiSet() { MultiSet unmodifiable = MultiSetUtils.unmodifiableMultiSet(multiSet); assertEquals(multiSet, unmodifiable); - + try { unmodifiable.add("a"); fail("Empty multi set must be read-only"); } catch (UnsupportedOperationException e) { } - + try { MultiSetUtils.unmodifiableMultiSet(null); fail("Expecting NPE"); } catch (NullPointerException e) { } } - + /** * Tests {@link MultiSetUtils#unmodifiableMultiSet(org.apache.commons.collections4.MultiSet) ()}. */ @Test public void testSynchronizedMultiSet() { MultiSet synced = MultiSetUtils.synchronizedMultiSet(multiSet); - assertEquals(multiSet, synced); + assertEquals(multiSet, synced); synced.add("a"); // ensure adding works } - + /** * Tests {@link MultiSetUtils#predicatedMultiSet(org.apache.commons.collections4.MultiSet, org.apache.commons.collections4.Predicate)}. */ @@ -101,13 +101,13 @@ public class MultiSetUtilsTest { MultiSet predicated = MultiSetUtils.predicatedMultiSet(multiSet, predicate); assertEquals(multiSet.size(), predicated.size()); assertEquals(multiSet.getCount("a"), predicated.getCount("a")); - + try { MultiSetUtils.predicatedMultiSet(null, predicate); fail("Expecting NPE"); } catch (NullPointerException e) { } - + try { MultiSetUtils.predicatedMultiSet(multiSet, null); fail("Expecting NPE"); diff --git a/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java b/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java index 73d84fbd9..369766b5d 100644 --- a/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/Flat3MapTest.java @@ -451,7 +451,7 @@ public class Flat3MapTest extends AbstractIterableMapTest { // object is not existing Object obj = m.remove(44); assertNull(obj); - + m.put(ONE, ONE); obj = m.remove(ONE); assertSame(ONE, obj); @@ -460,31 +460,31 @@ public class Flat3MapTest extends AbstractIterableMapTest { // after removal, be no longer there obj = m.get(ONE); assertNull(obj); - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); - - obj = m.remove(ONE); + + obj = m.remove(ONE); assertSame(ONE, obj); - + obj = m.get(ONE); assertNull(obj); obj = m.get(TWO); assertSame(TWO, obj); } - + public void testRemove2() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); - + obj = m.remove(ONE); assertSame(ONE, obj); - + obj = m.get(ONE); assertNull(obj); obj = m.get(TWO); @@ -492,18 +492,18 @@ public class Flat3MapTest extends AbstractIterableMapTest { obj = m.get(THREE); assertSame(THREE, obj); } - + public void testRemove3() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); - + obj = m.remove(TWO); assertSame(TWO, obj); - + obj = m.get(ONE); assertSame(ONE, obj); obj = m.get(TWO); @@ -511,18 +511,18 @@ public class Flat3MapTest extends AbstractIterableMapTest { obj = m.get(THREE); assertSame(THREE, obj); } - + public void testRemove4() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); - + obj = m.remove(THREE); assertSame(THREE, obj); - + obj = m.get(ONE); assertSame(ONE, obj); obj = m.get(TWO); @@ -530,63 +530,63 @@ public class Flat3MapTest extends AbstractIterableMapTest { obj = m.get(THREE); assertNull(obj); } - + public void testRemove5() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(null, ONE); - + obj = m.remove(null); assertSame(ONE, obj); - + obj = m.get(null); assertNull(obj); } - + public void testRemove6() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(null, TWO); - + obj = m.remove(null); assertSame(TWO, obj); - + obj = m.get(ONE); assertSame(ONE, obj); obj = m.get(null); assertNull(obj); } - + public void testRemove7() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(null, ONE); m.put(TWO, TWO); - + obj = m.remove(null); assertSame(ONE, obj); - + obj = m.get(null); assertNull(obj); obj = m.get(TWO); assertSame(TWO, obj); } - + public void testRemove8() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(null, THREE); - + obj = m.remove(null); assertSame(THREE, obj); - + obj = m.get(ONE); assertSame(ONE, obj); obj = m.get(TWO); @@ -598,20 +598,20 @@ public class Flat3MapTest extends AbstractIterableMapTest { public void testRemove9() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); - + obj = m.remove(null); assertNull(obj); } - + public void testRemove10() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); - + obj = m.remove(null); assertNull(obj); } @@ -619,82 +619,82 @@ public class Flat3MapTest extends AbstractIterableMapTest { public void testRemove11() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); - + obj = m.remove(null); assertNull(obj); } - + public void testRemove12() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); - + obj = m.remove(42); assertNull(obj); } - + public void testRemove13() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); - + obj = m.remove(42); assertNull(obj); } - + public void testNewInstance1() { final Map orig = new HashMap<>(); orig.put(ONE, ONE); orig.put(TWO, TWO); - + final Flat3Map m = new Flat3Map<>(orig); - + assertEquals(orig, m); assertEquals(2, m.size()); } - + public void testGet1() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(null, ONE); obj = m.get(null); assertSame(ONE, obj); } - + public void testGet2() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(null, TWO); obj = m.get(null); assertSame(TWO, obj); } - + public void testGet3() { final Flat3Map m = new Flat3Map<>(); Object obj; - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(null, THREE); obj = m.get(null); assertSame(THREE, obj); } - + public void testContainsKey1() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(null, THREE); @@ -704,24 +704,24 @@ public class Flat3MapTest extends AbstractIterableMapTest { public void testContainsKey2() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(null, TWO); boolean contains = m.containsKey(null); assertEquals(true, contains); } - + public void testContainsKey3() { final Flat3Map m = new Flat3Map<>(); - + m.put(null, ONE); boolean contains = m.containsKey(null); assertEquals(true, contains); } - + public void testContainsValue1() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, null); @@ -731,24 +731,24 @@ public class Flat3MapTest extends AbstractIterableMapTest { public void testContainsValue2() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(TWO, null); boolean contains = m.containsValue(null); assertEquals(true, contains); } - + public void testContainsValue3() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, null); boolean contains = m.containsValue(null); assertEquals(true, contains); } - + public void testPut1() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(null, THREE); @@ -756,29 +756,29 @@ public class Flat3MapTest extends AbstractIterableMapTest { assertEquals(THREE, old); assertEquals(ONE, m.get(null)); } - + public void testPut2() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(null, THREE); Object old = m.put(null, ONE); assertEquals(THREE, old); assertEquals(ONE, m.get(null)); } - + public void testPut3() { final Flat3Map m = new Flat3Map<>(); - + m.put(null, THREE); Object old = m.put(null, ONE); assertEquals(THREE, old); assertEquals(null, m.get(ONE)); } - + public void testPut4() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(TWO, TWO); m.put(THREE, THREE); @@ -786,20 +786,20 @@ public class Flat3MapTest extends AbstractIterableMapTest { assertEquals(THREE, old); assertEquals(ONE, m.get(THREE)); } - + public void testPut5() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, ONE); m.put(TWO, THREE); Object old = m.put(TWO, ONE); assertEquals(THREE, old); assertEquals(ONE, m.get(TWO)); } - + public void testPut6() { final Flat3Map m = new Flat3Map<>(); - + m.put(ONE, THREE); Object old = m.put(ONE, ONE); assertEquals(THREE, old);