Interface SpliteratorContract<E,I extends Iterable<E>>
- Type Parameters:
E
- The element type being tested.I
- The type for the iterator being tested.
- All Superinterfaces:
CollectionContractConfig
,CollectionContractSupport<E,
,I> CollectionProviderSupport<E,
,I> ContractSupport<I>
,ElementProviderSupport<E>
,IteratorContract<E,
,I> ProviderSupport<I>
,SupportedMethods
- All Known Subinterfaces:
CollectionContract<E,
,C> IterableContract<E,
,I> ListContract<E,
,L> SequencedCollectionContract<E,
C>
This interface tests if a collection class has implemented the spliterator() method
correctly and that the spliterator that is returned satisfies the
Spliterator
contract.- Since:
- 1.0.0
- Author:
- evanbergstrom
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]
The full list of supported Spliterator characteristics.Fields inherited from interface org.soliscode.test.contract.support.CollectionContractSupport
DEFAULT_SIZE
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Tests that theSpliterator.hasCharacteristics(int)
method works.default void
Tests that theSpliterator.estimateSize()
method works on a collection with elements.default void
Tests that theSpliterator.estimateSize()
method works on an empty collection.default void
Tests that theSpliterator.forEachRemaining(java.util.function.Consumer<? super T>)
method works on a collection with elements.default void
Tests that theSpliterator.forEachRemaining(java.util.function.Consumer<? super T>)
method works on an empty collection.default void
Tests that theSpliterator.getExactSizeIfKnown()
method works on a collection with elements.default void
Tests that theSpliterator.getExactSizeIfKnown()
method works on an empty collection.default void
Tests that theSpliterator.tryAdvance(java.util.function.Consumer<? super T>)
method works on a collection with elements.default void
Tests that theSpliterator.tryAdvance(java.util.function.Consumer<? super T>)
method works on an empty collection.default void
Tests that theSpliterator.trySplit()
method works on a collection with elements.default void
Tests that theSpliterator.trySplit()
method works on an empty collection.Methods inherited from interface org.soliscode.test.contract.CollectionContractConfig
permitDuplicates, permitIncompatibleTypes, permitNulls
Methods inherited from interface org.soliscode.test.contract.support.CollectionProviderSupport
provider
Methods inherited from interface org.soliscode.test.contract.support.ElementProviderSupport
elementProvider
Methods inherited from interface org.soliscode.test.contract.iterable.IteratorContract
testForEachRemainingForNullAction, testForEachRemainingOverEntireCollection, testForEachRemainingOverPartialCollection, testIteratorOverCollectionWithElements, testIteratorOverEmptyCollection, testIteratorRemove, testIteratorRemoveThrowsOnIllegalState
Methods inherited from interface org.soliscode.test.SupportedMethods
supportsMethod
-
Field Details
-
CHARACTERISTIC_VALUES
static final int[] CHARACTERISTIC_VALUESThe full list of supported Spliterator characteristics.
-
-
Method Details
-
testHasCharacteristic
@Test @DisplayName("The hasCharacteristics method works") default void testHasCharacteristic()Tests that theSpliterator.hasCharacteristics(int)
method works. -
testSpliteratorGetExactSizeIfKnownOnAnEmptyCollection
@Test @DisplayName("The getExactSizeIfKnown method can be called on an empty container") default void testSpliteratorGetExactSizeIfKnownOnAnEmptyCollection()Tests that theSpliterator.getExactSizeIfKnown()
method works on an empty collection. -
testSpliteratorGetExactSizeIfKnownOnACollectionWithElements
@Test @DisplayName("The getExactSizeIfKnown method can be called on a container with elements") default void testSpliteratorGetExactSizeIfKnownOnACollectionWithElements()Tests that theSpliterator.getExactSizeIfKnown()
method works on a collection with elements. -
testSpliteratorEstimateSizeOnAnEmptyCollection
@Test @DisplayName("The estimateSize method can be called on an empty container") default void testSpliteratorEstimateSizeOnAnEmptyCollection()Tests that theSpliterator.estimateSize()
method works on an empty collection. -
testSpliteratorEstimateSizeOnACollectionWithElements
@Test @DisplayName("The Spliterator.estimateSize method can be called on a container with elements") default void testSpliteratorEstimateSizeOnACollectionWithElements()Tests that theSpliterator.estimateSize()
method works on a collection with elements. -
testSpliteratorForEachRemainingOnAnEmptyCollection
@Test @DisplayName("The Spliterator.forEachRemaining method can be called on an empty container") default void testSpliteratorForEachRemainingOnAnEmptyCollection()Tests that theSpliterator.forEachRemaining(java.util.function.Consumer<? super T>)
method works on an empty collection. -
testSpliteratorForEachRemainingOnACollectionWithElements
@Test @DisplayName("The Spliterator.forEachRemaining method can be called on a container with elements") default void testSpliteratorForEachRemainingOnACollectionWithElements()Tests that theSpliterator.forEachRemaining(java.util.function.Consumer<? super T>)
method works on a collection with elements. -
testSpliteratorTryAdvanceOnAnEmptyCollection
@Test @DisplayName("The Spliterator.tryAdvance method can be called on an empty container") default void testSpliteratorTryAdvanceOnAnEmptyCollection()Tests that theSpliterator.tryAdvance(java.util.function.Consumer<? super T>)
method works on an empty collection. -
testSpliteratorTryAdvanceOnACollectionWithElements
@Test @DisplayName("The Spliterator.tryAdvance method can be called on a container with elements") default void testSpliteratorTryAdvanceOnACollectionWithElements()Tests that theSpliterator.tryAdvance(java.util.function.Consumer<? super T>)
method works on a collection with elements. -
testSpliteratorTrySplitOnAnEmptyCollection
@Test @DisplayName("The Spliterator.trySplit method can be called on an empty container") default void testSpliteratorTrySplitOnAnEmptyCollection()Tests that theSpliterator.trySplit()
method works on an empty collection. -
testSpliteratorTrySplitOnACollectionWithElements
@Test @DisplayName("The Spliterator.trySplit method can be called on a container with elements") default void testSpliteratorTrySplitOnACollectionWithElements()Tests that theSpliterator.trySplit()
method works on a collection with elements.
-