private void replaceTargetAssignmentWithNewAssignment(
            ShareGroupHeartbeatResponseData.Assignment assignment) {
        currentTargetAssignment.clear();
        assignment.topicPartitions().forEach(topicPartitions ->
                currentTargetAssignment.put(topicPartitions.topicId(), new TreeSet<>(topicPartitions.partitions())));
    }
Overwrite the target assignment with the new target assignment.

@param assignment Target assignment received from the broker.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareMembershipManager.java