public static boolean isTimeoutException(Throwable exception) {
        if (exception == null) return false;
        if (exception instanceof ExecutionException) {
            exception = exception.getCause();
            if (exception == null) return false;
        }
        return exception instanceof TimeoutException;
    }
@Test
    public void testTimeoutExceptionIsTimeoutException() {
        assertTrue(isTimeoutException(new TimeoutException()));
    }