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 Collection |
createCollection()
Subclasses must override this method in order to construct
an empty Collection with the null argument constructor.
|
protected Collection |
createCollection(Collection input)
Subclasses must override this method in order to construct
a Collection with the elements found in the input Collection.
|
protected abstract Set |
createSet() |
protected abstract Set |
createSet(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 Collection createCollection()
AbstractCollectionTest
createCollection
in class AbstractCollectionTest
protected Collection createCollection(Collection input)
AbstractCollectionTest
createCollection
in class AbstractCollectionTest
input
- A possibly null and possibly empty collection of items
to seed the list withprotected abstract Set createSet()
protected abstract Set createSet(Collection input)
Copyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.