public abstract class ListIteratorTester<E> extends AbstractIteratorTester<E,java.util.ListIterator<E>>
IteratorTester for testing a ListIterator against a known
good reference implementation. As with IteratorTester, a concrete subclass must provide
target iterators on demand. It also requires three additional constructor parameters: elementsToInsert, the elements to be passed to set() and add() calls; features, the features supported by the iterator; and expectedElements, the elements the
iterator should return in order.
The items in elementsToInsert will be repeated if steps is larger than the
number of provided elements.
AbstractIteratorTester.KnownOrder, AbstractIteratorTester.MultiExceptionListIterator, AbstractIteratorTester.Stimulus<E,T extends java.util.Iterator<E>>add, hasNext, hasPrevious, next, nextIndex, previous, previousIndex, remove, set| Modifier | Constructor and Description |
|---|---|
protected |
ListIteratorTester(int steps,
java.lang.Iterable<E> elementsToInsert,
java.lang.Iterable<? extends IteratorFeature> features,
java.lang.Iterable<E> expectedElements,
int startIndex) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Iterable<? extends AbstractIteratorTester.Stimulus<E,? super java.util.ListIterator<E>>> |
getStimulusValues()
I'd like to make this a parameter to the constructor, but I can't because the stimulus
instances refer to
this. |
protected abstract java.util.ListIterator<E> |
newTargetIterator()
Returns a new target iterator each time it's called.
|
iteratorStimuli, listIteratorStimuli, test, testForEachRemaining, verifyprotected ListIteratorTester(int steps,
java.lang.Iterable<E> elementsToInsert,
java.lang.Iterable<? extends IteratorFeature> features,
java.lang.Iterable<E> expectedElements,
int startIndex)
protected final java.lang.Iterable<? extends AbstractIteratorTester.Stimulus<E,? super java.util.ListIterator<E>>> getStimulusValues()
AbstractIteratorTesterthis.getStimulusValues in class AbstractIteratorTester<E,java.util.ListIterator<E>>protected abstract java.util.ListIterator<E> newTargetIterator()
AbstractIteratorTesternewTargetIterator in class AbstractIteratorTester<E,java.util.ListIterator<E>>