public static Map<TaskName, String> generateTaskContainerMapping(Set<ContainerModel> containers) {
    Map<TaskName, String> taskMapping = new HashMap<>();
    for (ContainerModel container : containers) {
      for (TaskName taskName : container.getTasks().keySet()) {
        taskMapping.put(taskName, container.getId());
      }
    }
    return taskMapping;
  }
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