public Optional<String> computePreferredServerAssignor(
        ConsumerGroupMember oldMember,
        ConsumerGroupMember newMember
    ) {
        // Copy the current count and update it.
        Map<String, Integer> counts = new HashMap<>(this.serverAssignors);
        maybeUpdateServerAssignors(counts, oldMember, newMember);

        return counts.entrySet().stream()
            .max(Map.Entry.comparingByValue())
            .map(Map.Entry::getKey);
    }
Compute the preferred (server side) assignor for the group while
taking into account the updated member. The computation relies
on {{@link ConsumerGroup#serverAssignors}} persisted structure
but it does not update it.

@param oldMember The old member.
@param newMember The new member.

@return An Optional containing the preferred assignor.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java