public KafkaFuture<Void> all() {
        final KafkaFutureImpl<Void> result = new KafkaFutureImpl<>();

        partitions().whenComplete(
                (topicPartitions, throwable) -> {
                    if (throwable != null) {
                        result.completeExceptionally(throwable);
                    } else {
                        for (Optional<Throwable> exception : topicPartitions.values()) {
                            if (exception.isPresent()) {
                                result.completeExceptionally(exception.get());
                                return;
                            }
                        }
                        result.complete(null);
                    }
                });

        return result;
    }
Return a future which succeeds if all the topic elections succeed.
clients/src/main/java/org/apache/kafka/clients/admin/ElectLeadersResult.java