Abstract test class for {@link org.apache.commons.collections4.Bag Bag} methods and contracts.
To use, simply extend this class, and implement the {@link #makeObject} method.
If your bag fails one of these tests by design, you may still use this base set of cases. Simply override the test case (method) your bag fails.
Note: The Bag interface does not conform to the Collection interface so the generic collection tests from AbstractCollectionTest would normally fail. As a work-around since 4.0, a CollectionBag decorator can be used to make any Bag implementation comply to the Collection contract.
This abstract test class does wrap the concrete bag implementation with such a decorator, see the overridden {@link #resetEmpty()} and{@link #resetFull()} methods.
In addition to the generic collection tests (prefix testCollection) inherited from AbstractCollectionTest, there are test methods that test the "normal" Bag interface (prefix testBag). For Bag specific tests use the {@link #makeObject()} and {@link #makeFullCollection()} methods instead of {@link #resetEmpty()} and resetFull(),otherwise the collection will be wrapped by a {@link CollectionBag} decorator.
@version $Id: AbstractBagTest.java 1540860 2013-11-11 21:58:27Z ebourg $