private static Map<TaskName, TaskModel> getTaskModelForBuddyContainer(
      Map<TaskName, TaskModel> activeContainerTaskModel, int replicaNum) {
    Map<TaskName, TaskModel> standbyTaskModels = new HashMap<>();

    for (TaskName taskName : activeContainerTaskModel.keySet()) {
      TaskName standbyTaskName = StandbyTaskUtil.getStandbyTaskName(taskName, replicaNum);
      TaskModel standbyTaskModel =
          new TaskModel(standbyTaskName, activeContainerTaskModel.get(taskName).getSystemStreamPartitions(),
              activeContainerTaskModel.get(taskName).getChangelogPartition(), TaskMode.Standby);
      standbyTaskModels.put(standbyTaskName, standbyTaskModel);
    }

    LOG.info("Generated standbyTaskModels : {} for active task models : {}", standbyTaskModels,
        activeContainerTaskModel);
    return standbyTaskModels;
  }
Generate a container model map with standby tasks added and grouped into buddy containers.
 Package-private for testing.

@param containerModels The initial container model map.
@param replicationFactor The desired replication factor, if the replication-factor is n, we add n-1 standby tasks for each active task.
@return The generated map of containerModels with added containers, and the initial regular containers
samza-core/src/main/java/org/apache/samza/container/grouper/task/TaskNameGrouperProxy.java