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 testTopicExistsExceptionIsNotTimeoutException() {
        assertFalse(isTimeoutException(new TopicExistsException("Topic exists.")));
    }