@Override
        public void run() {
            try {
                try {
                    Thread.sleep(0, 200);
                } catch (InterruptedException e) {
                }
                if (exception == null) {
                    future.complete(value);
                } else {
                    future.completeExceptionally(exception);
                }
            } catch (Throwable testException) {
                this.testException = testException;
            }
        }
Asserts that the given future is done, didn't fail and was cancelled.
clients/src/test/java/org/apache/kafka/common/KafkaFutureTest.java