private static boolean endOfStream(Consumer<?, ?> consumer, Collection<TopicPartition> assignments) {
        Map<TopicPartition, Long> endOffsets = consumer.endOffsets(assignments);
        for (TopicPartition topicPartition : assignments) {
            if (consumer.position(topicPartition) < endOffsets.get(topicPartition)) {
                return false;
            }
        }
        return true;
    }
Translates a remote consumer group's offsets into corresponding local offsets. Topics are automatically
renamed according to the ReplicationPolicy.
@param consumerGroupId The group ID of remote consumer group
@param remoteClusterAlias The alias of remote cluster
@param timeout The maximum time to block when consuming from the checkpoints topic
connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/MirrorClient.java