Interface ListToArrayContract<E,L extends List<E>>

Type Parameters:
E - The element type being tested.
L - The list type being tested.
All Superinterfaces:
CollectionContractConfig, CollectionContractSupport<E,L>, CollectionProviderSupport<E,L>, ContractSupport<L>, ElementProviderSupport<E>, ProviderSupport<L>, SupportedMethods, ToArrayContract<E,L>
All Known Subinterfaces:
ListContract<E,L>

public interface ListToArrayContract<E,L extends List<E>> extends ToArrayContract<E,L>, CollectionContractSupport<E,L>
This contract tests if a list class has implemented the toArray method correctly.
Since:
1.0
Author:
evanbergstrom
See Also:
  • Method Details

    • testToArray

      @Test @DisplayName("The toArray method works on a container with elements") default void testToArray()
      Tests that the toArray() method works for a collection with elements.
      Specified by:
      testToArray in interface ToArrayContract<E,L extends List<E>>
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.
    • testToArrayIsSafe

      @Test @DisplayName("The toArray method returns a safe array") default void testToArrayIsSafe()
      Tests that the toArray() method returns a safe array that can be modified without changing the elements of the container.
      Specified by:
      testToArrayIsSafe in interface ToArrayContract<E,L extends List<E>>
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.