public static Map<TopicPartition, ListOffsetsResultInfo> getEndOffsets(final KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> endOffsetsFuture) {
        try {
            return endOffsetsFuture.get();
        } catch (final RuntimeException | InterruptedException | ExecutionException e) {
            LOG.warn("The listOffsets request failed.", e);
            throw new StreamsException("Unable to obtain end offsets from kafka", e);
        }
    }
A helper method that wraps the {@code Future#get} call and rethrows any thrown exception as a StreamsException
@throws StreamsException if the admin client request throws an exception
streams/src/main/java/org/apache/kafka/streams/processor/internals/ClientUtils.java