private void assertIsFailed(KafkaFuture<?> future) {
        assertTrue(future.isDone());
        assertFalse(future.isCancelled());
        assertTrue(future.isCompletedExceptionally());
    }
Asserts that the given future is done, failed and wasn't cancelled.
clients/src/test/java/org/apache/kafka/common/KafkaFutureTest.java