private List<Integer> allocations(Function<ConnectorsAndTasks, ? extends Collection<?>> allocation) {
        return memberAssignments.values().stream()
                .map(allocation)
                .map(Collection::size)
                .sorted()
                .collect(Collectors.toList());
    }
Assert that the task counts for each worker in the cluster match the expected counts.
For example, calling {@code assertTaskAllocations(0, 0, 2, 3)} ensures that there are two
workers in the cluster that are assigned no tasks, one worker that is assigned two tasks,
and one worker that is assigned three tasks.
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignorTest.java