assertEquals("Bag has at least 1 'A'", true, bag.contains("A"));
assertEquals("Bag has at least 1 'B'", true, bag.contains("B"));
}
public void testContainsAll() {
Bag bag = makeBag();
List known = new ArrayList();
List known1A = new ArrayList();
known1A.add("A");
List known2A = new ArrayList();
known2A.add("A");
known2A.add("A");
List known1B = new ArrayList();
known1B.add("B");
List known1A1B = new ArrayList();
known1A1B.add("A");
known1A1B.add("B");
assertEquals("Bag containsAll of empty", true, bag.containsAll(known));
assertEquals("Bag does not containsAll of 1 'A'", false, bag.containsAll(known1A));
assertEquals("Bag does not containsAll of 2 'A'", false, bag.containsAll(known2A));
assertEquals("Bag does not containsAll of 1 'B'", false, bag.containsAll(known1B));
assertEquals("Bag does not containsAll of 1 'A' 1 'B'", false, bag.containsAll(known1A1B));
bag.add("A"); // bag 1A
assertEquals("Bag containsAll of empty", true, bag.containsAll(known));
assertEquals("Bag containsAll of 1 'A'", true, bag.containsAll(known1A));
assertEquals("Bag does not containsAll of 2 'A'", false, bag.containsAll(known2A));
assertEquals("Bag does not containsAll of 1 'B'", false, bag.containsAll(known1B));
assertEquals("Bag does not containsAll of 1 'A' 1 'B'", false, bag.containsAll(known1A1B));
bag.add("A"); // bag 2A
assertEquals("Bag containsAll of empty", true, bag.containsAll(known));
assertEquals("Bag containsAll of 1 'A'", true, bag.containsAll(known1A));
assertEquals("Bag containsAll of 2 'A'", true, bag.containsAll(known2A));
assertEquals("Bag does not containsAll of 1 'B'", false, bag.containsAll(known1B));
assertEquals("Bag does not containsAll of 1 'A' 1 'B'", false, bag.containsAll(known1A1B));
bag.add("A"); // bag 3A
assertEquals("Bag containsAll of empty", true, bag.containsAll(known));
assertEquals("Bag containsAll of 1 'A'", true, bag.containsAll(known1A));
assertEquals("Bag containsAll of 2 'A'", true, bag.containsAll(known2A));
assertEquals("Bag does not containsAll of 1 'B'", false, bag.containsAll(known1B));
assertEquals("Bag does not containsAll of 1 'A' 1 'B'", false, bag.containsAll(known1A1B));
bag.add("B"); // bag 3A1B
assertEquals("Bag containsAll of empty", true, bag.containsAll(known));
assertEquals("Bag containsAll of 1 'A'", true, bag.containsAll(known1A));
assertEquals("Bag containsAll of 2 'A'", true, bag.containsAll(known2A));
assertEquals("Bag containsAll of 1 'B'", true, bag.containsAll(known1B));
assertEquals("Bag containsAll of 1 'A' 1 'B'", true, bag.containsAll(known1A1B));
}