public Map<TopicPartition, Long> endOffsets(Collection<TopicPartition> partitions, Timer timer) {
        return beginningOrEndOffset(partitions, ListOffsetsRequest.LATEST_TIMESTAMP, timer);
    }
Validate offsets for all assigned partitions for which a leader change has been detected.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java