public void waitForNextStableAssignment(final long maxWaitMs) throws InterruptedException {
            waitForCondition(
                () -> numStableAssignments() >= nextExpectedNumStableAssignments,
                maxWaitMs,
                () -> "Client did not reach " + nextExpectedNumStableAssignments + " stable assignments on time, " +
                    "numStableAssignments was " + numStableAssignments()
            );
        }
Waits for the assignment to stabilize after the group rebalances. You must call {@link #prepareForRebalance()}
prior to the rebalance-triggering event before using this method to wait.
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java