}
//--------------------------------------------------------------------------
public void testlegalAddRemove() {
Bag bag = makeTestBag();
assertEquals(0, bag.size());
Object[] els = new Object[]{"1", "3", "5", "7", "2", "4", "1"};
for (int i = 0; i < els.length; i++) {
bag.add(els[i]);
assertEquals(i + 1, bag.size());
assertEquals(true, bag.contains(els[i]));
}
Set set = ((PredicatedBag) bag).uniqueSet();
assertTrue("Unique set contains the first element", set.contains(els[0]));
assertEquals(true, bag.remove(els[0]));
set = ((PredicatedBag) bag).uniqueSet();
assertTrue("Unique set now does not contain the first element", !set.contains(els[0]));
}