private void simulateIncrementalRebalance() {
        ConsumerPartitionAssignor.GroupAssignment initialAssignment = assignor.assign(metadata, groupSubscription);
        Map<String, ConsumerPartitionAssignor.Subscription> newSubscriptions = new HashMap<>();
        subscriptions.forEach((member, subscription) ->
            newSubscriptions.put(
                member,
                subscriptionWithOwnedPartitions(
                    initialAssignment.groupAssignment().get(member).partitions(),
                    subscription
                )
            )
        );

        List<String> subscribedTopicsForNewMember;
        if (subscriptionType == HETEROGENEOUS) {
            subscribedTopicsForNewMember = subscriptions.get("member" + (memberCount - 2)).topics();
        } else {
            subscribedTopicsForNewMember = allTopicNames;
        }

        // Add new member to trigger a reassignment.
        newSubscriptions.put("newMember", subscription(
            subscribedTopicsForNewMember,
            memberCount - 1
        ));

        subscriptions = newSubscriptions;
    }
The assignment type is decided based on whether all the members are assigned partitions
for the first time (full), or incrementally when a rebalance is triggered.
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ClientSideAssignorBenchmark.java