public KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> all() {
        return KafkaFuture.allOf(futures.values().toArray(new KafkaFuture[0]))
                .thenApply(v -> {
                    Map<TopicPartition, ListOffsetsResultInfo> offsets = new HashMap<>(futures.size());
                    for (Map.Entry<TopicPartition, KafkaFuture<ListOffsetsResultInfo>> entry : futures.entrySet()) {
                        try {
                            offsets.put(entry.getKey(), entry.getValue().get());
                        } catch (InterruptedException | ExecutionException e) {
                            // This should be unreachable, because allOf ensured that all the futures completed successfully.
                            throw new RuntimeException(e);
                        }
                    }
                    return offsets;
                });
    }
Return a future which succeeds only if offsets for all specified partitions have been successfully
retrieved.
clients/src/main/java/org/apache/kafka/clients/admin/ListOffsetsResult.java