Class AssertContainsNoneByIdentity

java.lang.Object
org.soliscode.test.assertions.collection.IterableAssertion
org.soliscode.test.assertions.collection.AssertContainsNoneByIdentity

public final class AssertContainsNoneByIdentity extends IterableAssertion
A collection of utility methods that support asserting that a collection does not contain specific elements by identity.
Since:
1.0.0
Author:
evanbergstrom
  • Method Details

    • assertContainsNoneByIdentity

      public static void assertContainsNoneByIdentity(Iterable<?> excluded, Iterable<?> actual)
      Test if an iterable contains no element from a set of elements. Two elements are only considered the same is they have the same identity (i.e they are the same object).
      Parameters:
      excluded - The elements the iterable must not contain.
      actual - The iterable that should not contain the elements.
      Throws:
      org.opentest4j.AssertionFailedError - if the iterable contains any of the elements or if either of the iterable arguments is null.
    • assertContainsNoneByIdentity

      public static void assertContainsNoneByIdentity(Iterable<?> excluded, Iterable<?> actual, String message)
      Test if an iterable contains no element from a set of elements. Two elements are only considered the same is they have the same identity (i.e they are the same object).
      Parameters:
      excluded - The elements the iterable must not contain.
      actual - The iterable that should not contain the elements.
      message - The message to supply if the assertion fails.
      Throws:
      org.opentest4j.AssertionFailedError - if the iterable does not contain all the elements.
    • assertContainsNoneByIdentity

      public static void assertContainsNoneByIdentity(Iterable<?> excluded, Iterable<?> actual, Supplier<String> messageSupplier)
      Test if an iterable contains no element from a set of elements. Two elements are only considered the same is they have the same identity (i.e they are the same object).
      Parameters:
      excluded - The elements the iterable must not contain.
      actual - The iterable that should not contain the elements.
      messageSupplier - The supplier to call top generate message to supply if the assertion fails.
      Throws:
      org.opentest4j.AssertionFailedError - if the iterable does not contain all the elements.