--- old/test/java/util/Collection/ListDefaults.java 2013-09-04 14:04:40.120073700 -0700 +++ new/test/java/util/Collection/ListDefaults.java 2013-09-04 14:04:39.960073693 -0700 @@ -127,7 +127,7 @@ fail("expected NPE not thrown"); } catch (NullPointerException npe) {} try { - list.removeIf(null); + list.removeAll((Predicate)null); fail("expected NPE not thrown"); } catch (NullPointerException npe) {} try { @@ -181,7 +181,7 @@ } @Test - public void testRemoveIf() throws Exception { + public void testRemoveAll() throws Exception { final CollectionSupplier supplier = new CollectionSupplier(LIST_CLASSES, SIZE); for (final CollectionSupplier.TestCase test : supplier.get()) { @@ -189,7 +189,7 @@ final List list = ((List) test.collection); try { - list.removeIf(null); + list.removeAll((Predicate)null); fail("expected NPE not thrown"); } catch (NullPointerException npe) {} CollectionAsserts.assertContents(list, original); @@ -203,7 +203,7 @@ for (final CollectionSupplier.TestCase test : supplier.get()) { final List original = ((List) test.original); final List list = ((List) test.collection); - list.removeIf(pOdd); + list.removeAll(pOdd); for (int i : list) { assertTrue((i % 2) == 0); } @@ -212,7 +212,7 @@ assertTrue(list.contains(i)); } } - list.removeIf(pEven); + list.removeAll(pEven); assertTrue(list.isEmpty()); } @@ -224,7 +224,7 @@ final List subList = list.subList(SUBLIST_FROM, SUBLIST_TO); final List subListCopy = new ArrayList<>(subList); listCopy.removeAll(subList); - subList.removeIf(pOdd); + subList.removeAll(pOdd); for (int i : subList) { assertTrue((i % 2) == 0); } @@ -235,7 +235,7 @@ assertFalse(subList.contains(i)); } } - subList.removeIf(pEven); + subList.removeAll(pEven); assertTrue(subList.isEmpty()); // elements outside the view should remain CollectionAsserts.assertContents(list, listCopy); @@ -248,7 +248,7 @@ @Override public void call(final List list) { final List copy = new ArrayList<>(list); - list.removeIf(pOdd); + list.removeAll(pOdd); for (int i : list) { assertTrue((i % 2) == 0); } @@ -267,7 +267,7 @@ // remove the first element private void removeFirst(final List original, final List list, final AtomicInteger offset) { final AtomicBoolean first = new AtomicBoolean(true); - list.removeIf(x -> first.getAndSet(false)); + list.removeAll(x -> first.getAndSet(false)); CollectionAsserts.assertContents(original.subList(offset.getAndIncrement(), original.size()), list); } @@ -447,7 +447,7 @@ } @Test - public void testRemoveIfThrowsCME() throws Exception { + public void testRemoveAllThrowsCME() throws Exception { final CollectionSupplier supplier = new CollectionSupplier(LIST_CME_CLASSES, SIZE); for (final CollectionSupplier.TestCase test : supplier.get()) { final List list = ((List) test.collection); @@ -457,7 +457,7 @@ boolean gotException = false; try { // bad predicate that modifies its list, should throw CME - list.removeIf((x) -> {return list.add(x);}); + list.removeAll((x) -> {return list.add(x);}); } catch (ConcurrentModificationException cme) { gotException = true; } @@ -524,13 +524,13 @@ } @Test(dataProvider = "shortIntListProvider") - public void testRemoveIfFromSlice(final List list) throws Exception { + public void testRemoveAllFromSlice(final List list) throws Exception { final List sublist = list.subList(3, 6); - assertTrue(sublist.removeIf(x -> x == 4)); + assertTrue(sublist.removeAll(x -> x == 4)); CollectionAsserts.assertContents(list, SLICED_EXPECTED); final List sublist2 = list.subList(2, 5); - assertTrue(sublist2.removeIf(x -> x == 3)); + assertTrue(sublist2.removeAll(x -> x == 3)); CollectionAsserts.assertContents(list, SLICED_EXPECTED2); } }