public static boolean hasCause(Throwable t, Class<? extends Throwable> exceptionClass) {
        if (t.getClass().isAssignableFrom(exceptionClass)) return true;
        if (t.getCause() != null) {
            return hasCause(t.getCause(), exceptionClass);
        }
        return false;
    }
@Test
    void hasCauseReturnsFalseIfExceptionDoesNotHaveGivenCause() {
        final boolean hasInterruptedExceptionAsCause = Exceptions.hasCause(new RuntimeException(new IllegalStateException()), InterruptedException.class);
        assertThat(hasInterruptedExceptionAsCause).isFalse();
    }