private void assignTasksToContainers(int[] taskCountPerContainer,List<String> taskNamesToAssign,List<TaskGroup> containers){
  for (  TaskGroup taskGroup : containers) {
    for (int j=taskGroup.size(); j < taskCountPerContainer[taskGroup.getContainerId()]; j++) {
      String taskName=taskNamesToAssign.remove(0);
      taskGroup.addTaskName(taskName);
      log.info("Assigned task {} to container {}",taskName,taskGroup.getContainerId());
    }
  }
}

private void assignTasksToContainers ( int [ ] taskCountPerContainer , List < String > taskNamesToAssign , List < TaskGroup > containers ) { for ( TaskGroup taskGroup : containers ) { for ( int j = taskGroup . size ( ) ; j < taskCountPerContainer [ taskGroup . getContainerId ( ) ] ; j ++ ) { String taskName = taskNamesToAssign . remove ( 0 ) ; taskGroup . addTaskName ( taskName ) ; log . info ( "Assigned task {} to container {}" , taskName , taskGroup . getContainerId ( ) ) ; } } }
assigns tasks from the specified list to containers that have fewer containers than indicated in taskcountpercontainer .
