public abstract class AbstractSetTest extends AbstractCollectionTest
Subclasses must implement the methods that return Sets from the two most common types of constructors, the zero argument constructor and the single argument Collection constructor.
In general, sets do not allow for duplicate entries, but this may not be true of all sets. All of the same questions about Collections can also be overriden for Sets
Constructor and Description |
---|
AbstractSetTest() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Collection |
createCollection()
Subclasses must override this method in order to construct
an empty Collection with the null argument constructor.
|
protected java.util.Collection |
createCollection(java.util.Collection input)
Subclasses must override this method in order to construct
a Collection with the elements found in the input Collection.
|
protected abstract java.util.Set |
createSet() |
protected abstract java.util.Set |
createSet(java.util.Collection input) |
protected boolean |
doesCollectionSupportDuplicateElements()
Subclasses should override this method if their Set
implementation allows duplicate elements.
|
doesCollectionAllowNullElements, doesCollectionDelegateFromOriginalCollection, doesCollectionsIteratorSupportRemove, doesCollectionSupportEmpty, doesCollectionSupportRemove, doesCollectionSupportRetainAll, getElement, isCollectionArgumentConstructorSupported, isNullArgumentConstructorSupported, testAddAllThrows, testAddAllWithEmptyCollectionAndEmptyInput, testAddAllWithNonEmptyCollectionAndEmptyInput, testAddAllWithNonEmptyCollectionAndNonEmptyInputDups, testAddAllWithNonEmptyCollectionAndNonEmptyInputNoDups, testAddOneThousandEntries, testAddReturnsProperValueForDuplicateAdd, testAddReturnsProperValueForNonDuplicateAdd, testCanAddToCollection, testCanCollectionHaveNullAndNonNullElements, testCanCollectionHaveNullElements, testClearWorksOnEmptyCollection, testClearWorksOnNonEmptyCollection, testCollectionFromCollectionConstructorHasZeroSize, testCollectionFromNullConstructorHasZeroSize, testCollectionToArrayWithArgumentWithCollectionOfMultipleItems, testCollectionToArrayWithArgumentWithCollectionOfOneItem, testCollectionToArrayWithArgumentWithEmptyCollection, testCollectionToArrayWithArgumentWithNullThrows, testCollectionToArrayWithCollectionOfMultipleItems, testCollectionToArrayWithCollectionOfOneItem, testCollectionToArrayWithEmptyCollection, testContainsAfterAdd, testContainsAllThrows, testContainsAllWithEmptyCollectionAndEmptyInput, testContainsAllWithNonEmptyCollectionAndCorrectInput, testContainsAllWithNonEmptyCollectionAndEmptyInput, testContainsAllWithNonEmptyCollectionAndIncorrectInput, testDoubleIteratorRemoveThrows, testFallingOffEndOfEmptyIteratorThrows, testFallingOffEndOfNonEmptyIteratorThrows, testIteratorRemoveOnEmptyIteratorThrows, testIteratorReturnedFromEmptyList, testListColnstructedWithNullCollectionThrows, testModifyingOriginalCollectionDoesNotAffectNewCollection, testMultipleItemIterator, testMultipleItemIteratorRemoval, testRemoveAllThrows, testRemoveAllWithEmptyCollectionAndEmptyInput, testRemoveAllWithNonEmptyCollectionAndEmptyInput, testRemoveAllWithNonEmptyCollectionAndNonEmptyInput, testRemoveAllWithNonEmptyCollectionAndNonEmptyInputWithExtras, testRemoveFirstThingFromMultiElementList, testRemoveFromEmptyList, testRemoveFromOneElementList, testRemoveLastThingFromMultiElementList, testRemoveMiddleThingFromMultiElementList, testRetainAllThrows, testRetainAllWithEmptyCollectionAndEmptyInput, testRetainAllWithNonEmptyCollectionAndEmptyInput, testRetainAllWithNonEmptyCollectionAndNonEmptyInput, testRetainAllWithNonEmptyCollectionAndNonEmptyInputWithExtras, testSingleItemIterator, testSingleItemIteratorRemoval, testUnsupporedRemoveIteratorThrows, testUnsupportedClearThrows, testUnsupportedRetainAllThrowsProperException
protected boolean doesCollectionSupportDuplicateElements()
doesCollectionSupportDuplicateElements
in class AbstractCollectionTest
protected java.util.Collection createCollection()
AbstractCollectionTest
createCollection
in class AbstractCollectionTest
protected java.util.Collection createCollection(java.util.Collection input)
AbstractCollectionTest
createCollection
in class AbstractCollectionTest
input
- A possibly null and possibly empty collection of items
to seed the list withprotected abstract java.util.Set createSet()
protected abstract java.util.Set createSet(java.util.Collection input)