private List<TaskGroup> createContainers(int startContainerId, int endContainerId) {
    List<TaskGroup> containers = new ArrayList<>(endContainerId - startContainerId);
    for (int i = startContainerId; i < endContainerId; i++) {
      TaskGroup taskGroup = new TaskGroup(String.valueOf(i), new ArrayList<String>());
      containers.add(taskGroup);
    }
    return containers;
  }
Creates a list of empty {@link TaskGroup} instances for a range of container id's
from the start(inclusive) to end(exclusive) container id.

@param startContainerId  the first container id for which a TaskGroup is needed.
@param endContainerId    the first container id AFTER the last TaskGroup that is needed.
@return                  a set of empty TaskGroup instances corresponding to the range
                         [startContainerId, endContainerId)
samza-core/src/main/java/org/apache/samza/container/grouper/task/GroupByContainerCount.java