public static int[] calculateTaskCountPerContainer(int taskCount, int currentContainerCount) {
    int[] newTaskCountPerContainer = new int[currentContainerCount];
    for (int i = 0; i < currentContainerCount; i++) {
      newTaskCountPerContainer[i] = taskCount / currentContainerCount;
      if (taskCount % currentContainerCount > i) {
        newTaskCountPerContainer[i]++;
      }
    }
    return newTaskCountPerContainer;
  }
Note: This is artificial. It makes assumptions about task grouping, changelog partition mapping, etc.
that will likely not be true at runtime, but are not the focus of this test.
samza-core/src/test/java/org/apache/samza/container/mock/ContainerMocks.java