public static boolean hasCauseOf(Throwable t, Class<? extends Throwable> causeType) {
        return Throwables.getCausalChain(t)
                .stream()
                .anyMatch(c -> causeType.isAssignableFrom(c.getClass()));
    }
@Test
    public void hasCauseOf_returnsTrueIfTheCauseIsSubtypeOfTheProvidedType() {
        assertThat(ExceptionUtils.hasCauseOf(
                new RuntimeException("parent", new SocketTimeoutException("asdasd")), IOException.class)).isTrue();

        assertThat(ExceptionUtils.hasCauseOf(
                new RuntimeException("parent", new IOException("asdasd")), IOException.class)).isTrue();
    }