private void reassignPartition(TopicPartition partition) {
            // find the new consumer
            String newConsumer = null;
            for (String anotherConsumer: sortedCurrentSubscriptions) {
                if (consumer2AllPotentialTopics.get(anotherConsumer).contains(partition.topic())) {
                    newConsumer = anotherConsumer;
                    break;
                }
            }

            assert newConsumer != null;

            reassignPartition(partition, newConsumer);
        }
Balance the current assignment using the data structures created in the assignPartitions(...) method above.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java