private static Map<TaskName, Set<SystemStreamPartition>> getTaskAssignments(JobModel jobModel) {
    Map<TaskName, Set<SystemStreamPartition>> taskAssignments = new HashMap<>();
    for (Map.Entry<String, ContainerModel> entry : jobModel.getContainers().entrySet()) {
      Map<TaskName, TaskModel> tasks = entry.getValue().getTasks();
      for (TaskModel taskModel : tasks.values()) {
        if (!taskAssignments.containsKey(taskModel.getTaskName())) {
          taskAssignments.put(taskModel.getTaskName(), new HashSet<>());
        }
        if (taskModel.getTaskMode() == TaskMode.Active) {
          taskAssignments.get(taskModel.getTaskName()).addAll(taskModel.getSystemStreamPartitions());
        }
      }
    }
    return taskAssignments;
  }
Computes the task to partition assignment of the {@param JobModel}.
@param jobModel the jobModel to compute task to partition assignment for.
@return the computed task to partition assignments of the {@param JobModel}.
samza-test/src/test/java/org/apache/samza/test/processor/TestZkLocalApplicationRunner.java