Class AbstractTestSet

All Implemented Interfaces:
Cloneable, junit.framework.Test
Direct Known Subclasses:
AbstractTestMap.TestMapEntrySet, AbstractTestMap.TestMapKeySet, AbstractTestSortedSet

public abstract class AbstractTestSet extends AbstractTestCollection
Abstract test class for Set methods and contracts.

Since Set doesn't stipulate much new behavior that isn't already found in Collection, this class basically just adds tests for Set.equals(java.lang.Object) and Set.hashCode() along with an updated verify() that ensures elements do not appear more than once in the set.

To use, subclass and override the makeEmptySet() method. You may have to override other protected methods if your set is not modifiable, or if your set restricts what kinds of elements may be added; see AbstractTestCollection for more details.

Since:
Commons Collections 3.0