private static boolean checkTaskOverlap(ContainerModel containerModel1, ContainerModel containerModel2) {
    Set<TaskName> activeTasksOnContainer1 = getCorrespondingActiveTasks(containerModel1);
    Set<TaskName> activeTasksOnContainer2 = getCorrespondingActiveTasks(containerModel2);
    return !Collections.disjoint(activeTasksOnContainer1, activeTasksOnContainer2);
  }
Given a containerID and job model, it returns the containerids of all containers that either have
 a. standby tasks corresponding to active tasks on the given container, or
 b. have active tasks corresponding to standby tasks on the given container.
 This is used to ensure that an active task and all its corresponding standby tasks are on separate hosts, and
 standby tasks corresponding to the same active task are on separate hosts.
samza-core/src/main/java/org/apache/samza/clustermanager/StandbyTaskUtil.java