Class BreakableCollectionTest
java.lang.Object
org.soliscode.test.OptionalMethodSupport
org.soliscode.test.AbstractTest
org.soliscode.test.breakable.BreakableCollectionTest
- All Implemented Interfaces:
AddAllContract<Integer,
,BreakableCollection<Integer>> AddContract<Integer,
,BreakableCollection<Integer>> ClearContract<Integer,
,BreakableCollection<Integer>> CollectionContract<Integer,
,BreakableCollection<Integer>> ContainsAllContract<Integer,
,BreakableCollection<Integer>> ContainsContract<Integer,
,BreakableCollection<Integer>> IsEmptyContract<Integer,
,BreakableCollection<Integer>> RemoveAllContract<Integer,
,BreakableCollection<Integer>> RemoveContract<Integer,
,BreakableCollection<Integer>> RemoveIfContract<Integer,
,BreakableCollection<Integer>> RetainAllContract<Integer,
,BreakableCollection<Integer>> SizeContract<Integer,
,BreakableCollection<Integer>> StreamContract<Integer,
,BreakableCollection<Integer>> ToArrayContract<Integer,
,BreakableCollection<Integer>> CollectionContractConfig
,ForEachContract<Integer,
,BreakableCollection<Integer>> IterableContract<Integer,
,BreakableCollection<Integer>> IteratorContract<Integer,
,BreakableCollection<Integer>> SpliteratorContract<Integer,
,BreakableCollection<Integer>> EqualsContract<BreakableCollection<Integer>>
,HashCodeContract<BreakableCollection<Integer>>
,ObjectContract<BreakableCollection<Integer>>
,ToStringContract<BreakableCollection<Integer>>
,CollectionContractSupport<Integer,
,BreakableCollection<Integer>> CollectionProviderSupport<Integer,
,BreakableCollection<Integer>> ContractSupport<BreakableCollection<Integer>>
,ElementProviderSupport<Integer>
,ProviderSupport<BreakableCollection<Integer>>
,WithIntegerElement
,SupportedMethods
public class BreakableCollectionTest
extends AbstractTest
implements CollectionContract<Integer,BreakableCollection<Integer>>, WithIntegerElement
Tests for the
BreakableCollection
class. These tests determine if the breaks supported by this class result in the
behavior expected.- Since:
- 1.0
- Author:
- evanbergstrom
- See Also:
-
Field Summary
Fields inherited from interface org.soliscode.test.contract.support.CollectionContractSupport
DEFAULT_SIZE
Fields inherited from interface org.soliscode.test.contract.iterable.SpliteratorContract
CHARACTERISTIC_VALUES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull CollectionProvider
<Integer, BreakableCollection<Integer>> provider()
void
Test that theADD_ALWAYS_RETURNS_FALSE
break causes theadd(Object)
method to always return false.void
Test that theADD_ALWAYS_RETURNS_OPPOSITE_VALUE
break causes theadd(Object)
method to always return the opposite value.void
Test that theADD_ALWAYS_RETURNS_TRUE
break causes theadd(Object)
method to always return true.void
Test that theADD_DOES_NOT_ADD_ELEMENT
break causes theadd(Object)
method to not add the element.void
Test that theCONTAINS_ALL_ALWAYS_RETURNS_FALSE
break causes thecontainsAll(Collection)
method to always returntrue
.void
Test that theCONTAINS_ALL_ALWAYS_RETURNS_TRUE
break causes thecontainsAll
method to always returntrue
.void
Test that theCONTAINS_ALL_ALWAYS_RETURNS_OPPOSITE_VALUE
break causes thecontainsAll(Collection)
method to always return the opposite value.void
Test that theCONTAINS_ALWAYS_RETURNS_FALSE
break causes thecontains
method to always returntrue
.void
Test that theCONTAINS_RETURNS_OPPOSITE_VALUE
break causes thecontains
method to always return the opposite value.void
Test that theCONTAINS_ALWAYS_RETURNS_TRUE
break causes thecontains
method to always returntrue
.void
Test that theIS_EMPTY_ALWAYS_RETURNS_FALSE
break causes theisEmpty
method to always returnfalse
.void
Test that theIS_EMPTY_RETURNS_OPPOSITE_VALUE
break causes theisEmpty
method to always return the opposite value.void
Test that theIS_EMPTY_ALWAYS_RETURNS_TRUE
break causes theisEmpty
method to always returntrue
.void
Test that theREMOVE_ALWAYS_RETURNS_FALSE
break causes theremove(Object)
method always returnsfalse
.void
Test that theREMOVE_ALWAYS_RETURNS_OPPOSITE_VALUE
break causes theremove(Object)
method always returnsfalse
.void
Test that theREMOVE_ALWAYS_RETURNS_TRUE
break causes theremove(Object)
method always returnstrue
.void
Test that theREMOVE_DOES_NOT_REMOVE_ELEMENT
break causes theremove(Object)
method to not remove the element.void
Test that theSIZE_ALWAYS_RETURNS_CONSTANT_VALUE
break causes thesize
method to return a constant value.void
Test that theSIZE_ALWAYS_RETURNS_ZERO
break causes thesize
method to return zero.void
Test that theTO_ARRAY_RETURNS_EMPTY_ARRAY
break causes thetoArray()
method to always returns an empty array.void
Test that theTO_ARRAY_RETURNS_NULL
break causes thetoArray()
method to always returnnull
.` value.void
Test that theTO_ARRAY_MISSING_FIRST_ELEMENT
break causes thetoArray()
method to return an array that is missing the first element.void
Test that theTO_ARRAY_MISSING_LAST_ELEMENT
break causes thetoArray()
method to return an array that is missing the first element.void
Test that theTO_ARRAY_STORE_RETURNS_EMPTY_ARRAY
break causes thetoArray(Object[])
method to always returns an empty array.void
Test that theTO_ARRAY_STORE_RETURNS_NULL
break causes thetoArray(Object[])
method to always returnnull
.` value.void
Test that theTO_ARRAY_STORE_DOES_NOT_COPY_ELEMENTS
break causes thetoArray(Object[])
method to return an array that is missing the last element.void
Test that theTO_ARRAY_STORE_MISSING_FIRST_ELEMENT
break causes thetoArray()
method to return an array that is missing the first element.void
Test that theTO_ARRAY_STORE_MISSING_LAST_ELEMENT
break causes thetoArray(Object[])
method to return an array that is missing the last element.Methods inherited from class org.soliscode.test.OptionalMethodSupport
doesNotSupportMethod, supportsMethod, unsupportedMethods
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.soliscode.test.contract.collection.AddAllContract
testAddAllToContainer, testAddAllWithDuplicateValue, testAddAllWithNullValue
Methods inherited from interface org.soliscode.test.contract.collection.AddContract
addWithDuplicateValue, testAdd, testAddWithNullValue
Methods inherited from interface org.soliscode.test.contract.collection.ClearContract
testClearOnCollectionWithElements, testClearOnEmptyCollection
Methods inherited from interface org.soliscode.test.contract.collection.CollectionContract
doesNotSupportMethod, doesNotSupportModification, supportsMethod
Methods inherited from interface org.soliscode.test.contract.CollectionContractConfig
permitDuplicates, permitIncompatibleTypes, permitNulls
Methods inherited from interface org.soliscode.test.contract.collection.ContainsAllContract
testContainsAllOnCollectionWithElements, testContainsAllOnCollectionWithNulls, testContainsAllOnEmptyCollection, testContainsAllWithIncompatibleType
Methods inherited from interface org.soliscode.test.contract.collection.ContainsContract
testContainsOnCollectionWithElements, testContainsOnCollectionWithNulls, testContainsOnEmptyCollection, testContainsWithIncompatibleType
Methods inherited from interface org.soliscode.test.contract.object.EqualsContract
testEqualsForNullValue, testEqualsIsConsistent, testEqualsIsReflexive, testEqualsIsSymmetric, testEqualsIsTransitive
Methods inherited from interface org.soliscode.test.contract.iterable.ForEachContract
testForEachForEmptyCollection, testForEachWithNullAction, testForeEachOverCollectionWithElements
Methods inherited from interface org.soliscode.test.contract.object.HashCodeContract
testHashCodeDistribution, testHashCodeIsStable, testHashCodeWithEqualValues, testHashDifferentValues
Methods inherited from interface org.soliscode.test.contract.collection.IsEmptyContract
testIsEmptyForEmptyCollection, testIsEmptyForNonEmptyCollection
Methods inherited from interface org.soliscode.test.contract.iterable.IteratorContract
testForEachRemainingForNullAction, testForEachRemainingOverEntireCollection, testForEachRemainingOverPartialCollection, testIteratorOverCollectionWithElements, testIteratorOverEmptyCollection, testIteratorRemove, testIteratorRemoveThrowsOnIllegalState
Methods inherited from interface org.soliscode.test.contract.collection.RemoveAllContract
testRemoveAllOnContainerWithElements, testRemoveAllOnEmptyContainer, testRemoveAllOnIncompatibleObject, testRemoveAllOnNullElement, testRemoveAllThrowsOnNullCollection
Methods inherited from interface org.soliscode.test.contract.collection.RemoveContract
testRemoveOnContainerWithElements, testRemoveOnContainerWithNulls, testRemoveOnEmptyContainer, testRemoveOnIncompatibleObject
Methods inherited from interface org.soliscode.test.contract.collection.RemoveIfContract
testRemoveIfOnContainerWithElements, testRemoveIfOnEmptyContainer, testRemoveIfThrowsOnANullFilter
Methods inherited from interface org.soliscode.test.contract.collection.RetainAllContract
testRetainAllOnContainerWithElements, testRetainAllOnEmptyContainer, testRetainAllOnIncompatibleObject, testRetainAllThrowsOnNullCollection
Methods inherited from interface org.soliscode.test.contract.collection.SizeContract
testSizeOnCollectionWithElements, testSizeOnEmptyCollection
Methods inherited from interface org.soliscode.test.contract.iterable.SpliteratorContract
testHasCharacteristic, testSpliteratorEstimateSizeOnACollectionWithElements, testSpliteratorEstimateSizeOnAnEmptyCollection, testSpliteratorForEachRemainingOnACollectionWithElements, testSpliteratorForEachRemainingOnAnEmptyCollection, testSpliteratorGetExactSizeIfKnownOnACollectionWithElements, testSpliteratorGetExactSizeIfKnownOnAnEmptyCollection, testSpliteratorTryAdvanceOnACollectionWithElements, testSpliteratorTryAdvanceOnAnEmptyCollection, testSpliteratorTrySplitOnACollectionWithElements, testSpliteratorTrySplitOnAnEmptyCollection
Methods inherited from interface org.soliscode.test.contract.collection.StreamContract
testParallelStreamForCollectionWithElements, testParallelStreamForEmptyCollection, testStreamForCollectionWithElements, testStreamForEmptyCollection
Methods inherited from interface org.soliscode.test.contract.collection.ToArrayContract
testToArray, testToArrayIsSafe, testToArrayOnEmptyCollection, testToArrayStore, testToArrayStoreOnEmptyCollection, testToArrayStoreThrowsOnNullArray
Methods inherited from interface org.soliscode.test.contract.object.ToStringContract
testToStringForDifferentValues, testToStringForEqualValues, testToStringIsConsistent, testToStringOverridden
Methods inherited from interface org.soliscode.test.contract.support.WithIntegerElement
elementProvider
-
Constructor Details
-
BreakableCollectionTest
public BreakableCollectionTest()
-
-
Method Details
-
provider
- Specified by:
provider
in interfaceCollectionProviderSupport<Integer,
BreakableCollection<Integer>> - Specified by:
provider
in interfaceProviderSupport<BreakableCollection<Integer>>
-
testSizeWithSizeAlwaysReturnsZeroBreak
@Test @DisplayName("Test the `size` method with the SIZE_ALWAYS_RETURNS_ZERO break") public void testSizeWithSizeAlwaysReturnsZeroBreak()Test that theSIZE_ALWAYS_RETURNS_ZERO
break causes thesize
method to return zero.- See Also:
-
testSizeWithSizeAlwaysReturnsConstantValueBreak
@Test @DisplayName("Test the `size` method with the SIZE_ALWAYS_RETURNS_CONSTANT_VALUE break") public void testSizeWithSizeAlwaysReturnsConstantValueBreak()Test that theSIZE_ALWAYS_RETURNS_CONSTANT_VALUE
break causes thesize
method to return a constant value.- See Also:
-
testIsEmptyAlwaysReturnsTrueBreak
@Test @DisplayName("Test the `size` method with the IS_EMPTY_ALWAYS_RETURNS_TRUE break") public void testIsEmptyAlwaysReturnsTrueBreak()Test that theIS_EMPTY_ALWAYS_RETURNS_TRUE
break causes theisEmpty
method to always returntrue
.- See Also:
-
testIsEmptyAlwaysReturnsFalseBreak
@Test @DisplayName("Test the `size` method with the IS_EMPTY_ALWAYS_RETURNS_FALSE break") public void testIsEmptyAlwaysReturnsFalseBreak()Test that theIS_EMPTY_ALWAYS_RETURNS_FALSE
break causes theisEmpty
method to always returnfalse
.- See Also:
-
testIsEmptyAlwaysReturnsOppositeValueBreak
@Test @DisplayName("Test the `size` method with the IS_EMPTY_RETURNS_OPPOSITE_VALUE break") public void testIsEmptyAlwaysReturnsOppositeValueBreak()Test that theIS_EMPTY_RETURNS_OPPOSITE_VALUE
break causes theisEmpty
method to always return the opposite value.- See Also:
-
testContainsAlwaysReturnsTrueBreak
@Test @DisplayName("Test the `contains(Object)` method with the CONTAINS_ALWAYS_RETURNS_TRUE break") public void testContainsAlwaysReturnsTrueBreak()Test that theCONTAINS_ALWAYS_RETURNS_TRUE
break causes thecontains
method to always returntrue
.- See Also:
-
testContainsAlwaysReturnsFalseBreak
@Test @DisplayName("Test the `contains(Object)` method with the CONTAINS_ALWAYS_RETURNS_FALSE break") public void testContainsAlwaysReturnsFalseBreak()Test that theCONTAINS_ALWAYS_RETURNS_FALSE
break causes thecontains
method to always returntrue
.- See Also:
-
testContainsAlwaysReturnsOppositeValueBreak
@Test @DisplayName("Test the `contains(Object)` method with the CONTAINS_RETURNS_OPPOSITE_VALUE break") public void testContainsAlwaysReturnsOppositeValueBreak()Test that theCONTAINS_RETURNS_OPPOSITE_VALUE
break causes thecontains
method to always return the opposite value.- See Also:
-
testToArrayAlwaysReturnsNullBreak
@Test @DisplayName("Test the `toArray()` method with the TO_ARRAY_RETURNS_NULL break") public void testToArrayAlwaysReturnsNullBreak()Test that theTO_ARRAY_RETURNS_NULL
break causes thetoArray()
method to always returnnull
.` value.- See Also:
-
testToArrayAlwaysReturnsEmptyArrayBreak
@Test @DisplayName("Test the `toArray()` method with the TO_ARRAY_RETURNS_EMPTY_ARRAY break") public void testToArrayAlwaysReturnsEmptyArrayBreak()Test that theTO_ARRAY_RETURNS_EMPTY_ARRAY
break causes thetoArray()
method to always returns an empty array.- See Also:
-
testToArrayMissingFirstElementBreak
@Test @DisplayName("Test the `toArray()` method with the TO_ARRAY_MISSING_FIRST_ELEMENT break") public void testToArrayMissingFirstElementBreak()Test that theTO_ARRAY_MISSING_FIRST_ELEMENT
break causes thetoArray()
method to return an array that is missing the first element.- See Also:
-
testToArrayMissingLastElementBreak
@Test @DisplayName("Test the `toArray()` method with the TO_ARRAY_MISSING_LAST_ELEMENT break") public void testToArrayMissingLastElementBreak()Test that theTO_ARRAY_MISSING_LAST_ELEMENT
break causes thetoArray()
method to return an array that is missing the first element.- See Also:
-
testToArrayStoreAlwaysReturnsNullBreak
@Test @DisplayName("Test the `toArray(Object[])` method with the TO_ARRAY_STORE_RETURNS_NULL break") public void testToArrayStoreAlwaysReturnsNullBreak()Test that theTO_ARRAY_STORE_RETURNS_NULL
break causes thetoArray(Object[])
method to always returnnull
.` value.- See Also:
-
testToArrayStoreAlwaysReturnsEmptyArrayBreak
@Test @DisplayName("Test the `toArray(Object[])` method with the TO_ARRAY_STORE_RETURNS_EMPTY_ARRAY break") public void testToArrayStoreAlwaysReturnsEmptyArrayBreak()Test that theTO_ARRAY_STORE_RETURNS_EMPTY_ARRAY
break causes thetoArray(Object[])
method to always returns an empty array.- See Also:
-
testToArrayStoreMissingFirstElementBreak
@Test @DisplayName("Test the `toArray(Object[])` method with the TO_ARRAY_STORE_MISSING_FIRST_ELEMENT break") public void testToArrayStoreMissingFirstElementBreak()Test that theTO_ARRAY_STORE_MISSING_FIRST_ELEMENT
break causes thetoArray()
method to return an array that is missing the first element.- See Also:
-
testToArrayStoreMissingLastElementBreak
@Test @DisplayName("Test the `toArray(Object[])` method with the TO_ARRAY_STORE_MISSING_LAST_ELEMENT break") public void testToArrayStoreMissingLastElementBreak()Test that theTO_ARRAY_STORE_MISSING_LAST_ELEMENT
break causes thetoArray(Object[])
method to return an array that is missing the last element.- See Also:
-
testToArrayStoreDoesNotCopyElementsBreak
@Test @DisplayName("Test the `toArray(Object[])` method with the TO_ARRAY_STORE_DOES_NOT_COPY_ELEMENTS break") public void testToArrayStoreDoesNotCopyElementsBreak()Test that theTO_ARRAY_STORE_DOES_NOT_COPY_ELEMENTS
break causes thetoArray(Object[])
method to return an array that is missing the last element.- See Also:
-
testAddDoesNotAddElementBreak
@Test @DisplayName("test the `add()` method with the ADD_DOES_NOT_ADD_ELEMENT break") public void testAddDoesNotAddElementBreak()Test that theADD_DOES_NOT_ADD_ELEMENT
break causes theadd(Object)
method to not add the element.- See Also:
-
testAddAlwaysReturnTrueBreak
@Test @DisplayName("test the `add(Object)` method with the ADD_ALWAYS_RETURNS_TRUE break") public void testAddAlwaysReturnTrueBreak()Test that theADD_ALWAYS_RETURNS_TRUE
break causes theadd(Object)
method to always return true.- See Also:
-
testAddAlwaysReturnFalseBreak
@Test @DisplayName("test the `add(Object)` method with the ADD_ALWAYS_RETURNS_FALSE break") public void testAddAlwaysReturnFalseBreak()Test that theADD_ALWAYS_RETURNS_FALSE
break causes theadd(Object)
method to always return false.- See Also:
-
testAddAlwaysReturnsOppositeValueBreak
@Test @DisplayName("test the `add(Object)` method with the ADD_ALWAYS_RETURNS_OPPOSITE_VALUE break") public void testAddAlwaysReturnsOppositeValueBreak()Test that theADD_ALWAYS_RETURNS_OPPOSITE_VALUE
break causes theadd(Object)
method to always return the opposite value.- See Also:
-
testRemoveDoesNotRemoveElementBreak
@Test @DisplayName("test the `remove(Object)` method with the REMOVE_DOES_NOT_REMOVE_ELEMENT break") public void testRemoveDoesNotRemoveElementBreak()Test that theREMOVE_DOES_NOT_REMOVE_ELEMENT
break causes theremove(Object)
method to not remove the element.- See Also:
-
testRemoveAlwaysReturnsTrueBreak
@Test @DisplayName("test the `remove(Object)` method with the REMOVE_ALWAYS_RETURNS_TRUE break") public void testRemoveAlwaysReturnsTrueBreak()Test that theREMOVE_ALWAYS_RETURNS_TRUE
break causes theremove(Object)
method always returnstrue
.- See Also:
-
testRemoveAlwaysReturnsFalseBreak
@Test @DisplayName("test the `remove(Object)` method with the REMOVE_ALWAYS_RETURNS_FALSE break") public void testRemoveAlwaysReturnsFalseBreak()Test that theREMOVE_ALWAYS_RETURNS_FALSE
break causes theremove(Object)
method always returnsfalse
.- See Also:
-
testRemoveAlwaysReturnsOppositeValueBreak
@Test @DisplayName("test the `remove(Object)` method with the REMOVE_ALWAYS_RETURNS_OPPOSITE_VALUE break") public void testRemoveAlwaysReturnsOppositeValueBreak()Test that theREMOVE_ALWAYS_RETURNS_OPPOSITE_VALUE
break causes theremove(Object)
method always returnsfalse
.- See Also:
-
testContainsAllAlwaysReturnsTrueBreak
@Test @DisplayName("Test the `containsAll(Collection)` method with the CONTAINS_ALL_ALWAYS_RETURNS_TRUE break") public void testContainsAllAlwaysReturnsTrueBreak()Test that theCONTAINS_ALL_ALWAYS_RETURNS_TRUE
break causes thecontainsAll
method to always returntrue
.- See Also:
-
testContainsAllAlwaysReturnsFalseBreak
@Test @DisplayName("Test the `contains(Object)` method with the CONTAINS_ALL_ALWAYS_RETURNS_FALSE break") public void testContainsAllAlwaysReturnsFalseBreak()Test that theCONTAINS_ALL_ALWAYS_RETURNS_FALSE
break causes thecontainsAll(Collection)
method to always returntrue
.- See Also:
-
testContainsAllReturnsOppositeValueBreak
@Test @DisplayName("Test the `containsAll(Collection)` method with the CONTAINS_ALL_ALWAYS_RETURNS_OPPOSITE_VALUE break") public void testContainsAllReturnsOppositeValueBreak()Test that theCONTAINS_ALL_ALWAYS_RETURNS_OPPOSITE_VALUE
break causes thecontainsAll(Collection)
method to always return the opposite value.- See Also:
-