예제 #1
0
 @Test
 public void testRemoveAllFail() {
   addStringsToCollection(bag);
   Set<String> remove = new HashSet<>();
   remove.add("Not in the list");
   Assert.assertFalse(bag.removeAll(remove));
   Assert.assertEquals(4, bag.size());
 }
예제 #2
0
  @Test
  public void testRemoveAllWithCollection() {
    addStringsToCollection(bag);
    Set<String> remove = new HashSet<>();
    addStringsToCollection(remove);

    Assert.assertTrue(bag.removeAll(remove));
    Assert.assertEquals(0, bag.size());
  }