private boolean maybeAssignPartitionToMember(
            TopicIdPartition topicIdPartition,
            String memberId
        ) {
            // If member is not subscribed to the partition's topic, return false without assigning.
            if (!groupSpec.memberSubscription(memberId).subscribedTopicIds().contains(topicIdPartition.topicId())) {
                return false;
            }

            // If the member's current assignment is already at max, return false without assigning.
            if (isMemberAtMaxCapacity(memberId)) {
                return false;
            }

            addPartitionToTargetAssignment(topicIdPartition, memberId);
            return true;
        }
Assigns partition to member if eligible.

@param topicIdPartition      The partition to be assigned.
@param memberId              The Id of the member.
@return true if the partition was assigned, false otherwise.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java