Class AssertIsEmpty

java.lang.Object
org.soliscode.test.assertions.collection.AssertIsEmpty

public final class AssertIsEmpty extends Object
A collection of utility methods that support asserting that a collection is empty.
Since:
1.0.0
Author:
evanbergstrom
  • Method Details

    • assertIsEmpty

      public static void assertIsEmpty(Iterable<?> actual)
      Assert that the collection is empty.
      Parameters:
      actual - The iterable that should be empty.
      Throws:
      org.opentest4j.AssertionFailedError - if the iterable is not empty or the iterable is null.
    • assertIsEmpty

      public static void assertIsEmpty(Iterable<?> actual, String message)
      Assert that the collection is empty.
      Parameters:
      actual - The iterable that should be empty.
      message - The message to supply if the assertion fails.
      Throws:
      org.opentest4j.AssertionFailedError - if the iterable is not empty or the iterable is null.
    • assertIsEmpty

      public static void assertIsEmpty(Iterable<?> actual, Supplier<String> messageSupplier)
      Assert that the iterable is empty.
      Parameters:
      actual - The iterable that should be empty.
      messageSupplier - The supplier to call top generate message to supply if the assertion fails.
      Throws:
      org.opentest4j.AssertionFailedError - if the iterable is not empty or the iterable is null.