public static void assertThrows(String message,
                                  Class<? extends Exception> expected,
                                  String containedInMessage,
                                  Callable callable) {
    AbstractThrowableAssert<?, ? extends Throwable> check = Assertions.assertThatThrownBy(callable::call)
        .withFailMessage(message)
        .isInstanceOf(expected);
    if (null != containedInMessage) {
      check.hasMessageContaining(containedInMessage);
    }
  }
A convenience method to avoid a large number of @Test(expected=...) tests
@param message A String message to describe this assertion
@param expected An Exception class that the Runnable should throw
@param containedInMessage A String that should be contained by the thrown
                          exception's message
@param callable A Callable that is expected to throw the exception
iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/AssertHelpers.java