public Map<TopicPartition, Long> endOffsets() {
        return endOffsets;
    }
This function will return a map of TopicPartitions and the highest offset seen so far in the Topic
streams/src/main/java/org/apache/kafka/streams/processor/TaskMetadata.java