@Test
public void testCatchValidSqlExceptionWithCause() {

    ExceptionTransformer<CustomRuntimeException> exceptionTransformer =
        new ExceptionTransformer<>(
            CustomRuntimeException.class,
            SQLException.class,
            SocketException.class);
    SocketException socketException = new SocketException("My custom SocketException");
    SQLException sqlException = new SQLException("My custom SQL Exception", socketException);
    Throwable actual = exceptionTransformer.transformException(sqlException);
    assertThat(actual).isInstanceOf(CustomRuntimeException.class);
    assertThat(actual).hasCause(sqlException);
    assertThat(ExceptionUtils.indexOfThrowable(actual, socketException.getClass())).isNotNegative();
}