Interface RemoveIfContract<E,C extends Collection<E>>

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

public interface RemoveIfContract<E,C extends Collection<E>> extends CollectionContractSupport<E,C>
This interface tests if a collection class has implemented the removeIf method correctly.
Since:
1.0.0
Author:
evanbergstrom
See Also:
  • Method Details

    • testRemoveIfOnEmptyContainer

      @Test @DisplayName("The removeIf method can be called on an empty container") default void testRemoveIfOnEmptyContainer()
      Tests that the removeIf method works on an empty container.
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.
    • testRemoveIfOnContainerWithElements

      @Test @DisplayName("The removeIf method works on a container with elements") default void testRemoveIfOnContainerWithElements()
      Tests that the removeIf method works on a container with elements.
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.
    • testRemoveIfThrowsOnANullFilter

      @Test @DisplayName("The removeIf method throws on a null filter") default void testRemoveIfThrowsOnANullFilter()
      Tests that the removeIf method throws an exception when passed a null filter.
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.
      Implementation Note:
      This test checks that the removeIf function throws the correct exception if it is called on a null value. IntelliJ will detect a problem when it is called with a null argument since the method declaration has a NotNull annotation. Since this is what we are trying to test, the inspection is suppressed here.