Interface CollectionContract<E,C extends Collection<E>>

Type Parameters:
E - The element type being tested.s
C - The collection type being tested.
All Superinterfaces:
AddAllContract<E,C>, AddContract<E,C>, ClearContract<E,C>, CollectionContractConfig, CollectionContractSupport<E,C>, CollectionProviderSupport<E,C>, ContainsAllContract<E,C>, ContainsContract<E,C>, ContractSupport<C>, ElementProviderSupport<E>, EqualsContract<C>, ForEachContract<E,C>, HashCodeContract<C>, IsEmptyContract<E,C>, IterableContract<E,C>, IteratorContract<E,C>, ObjectContract<C>, ProviderSupport<C>, RemoveAllContract<E,C>, RemoveContract<E,C>, RemoveIfContract<E,C>, RetainAllContract<E,C>, SizeContract<E,C>, SpliteratorContract<E,C>, StreamContract<E,C>, SupportedMethods, ToArrayContract<E,C>, ToStringContract<C>
All Known Subinterfaces:
ListContract<E,L>, SequencedCollectionContract<E,C>

Test suite for classes that implement the Collection interface. When implementing this class, the only method that will need to be implemented is ProviderSupport.provider(). Also, the following methods will allow the tests to be configured based upon the desired behavior of the collection class being tested:

For example, most of the collections from the JDK permit null values, permit duplicate values, and permit the search for incompatible types. To create a test class for ArrayList, the following constructor would be appropriate:

    public class ArrayListTest
        extends AbstractTest<Integer>
        implements TestCollection<ArrayList<Integer>, Integer>, WithIntegerElement<ArrayList<Integer>> {

    public ArrayListTest() {
        permitNulls(true);
        permitIncompatibleTypes(true);
        permitDuplicates(true);
    }
}
Since:
1.0
Author:
evanbergstrom
See Also: