@Test
    public void testFutureTimeoutWithZeroWait() {
        final KafkaFutureImpl<String> future = new KafkaFutureImpl<>();
        assertThrows(TimeoutException.class, () -> future.get(0, TimeUnit.MILLISECONDS));
    }
Asserts that the given future is done, didn't fail and was cancelled.
clients/src/test/java/org/apache/kafka/common/KafkaFutureTest.java