code: TaskInProgress[] getTasks(TaskType type) {
      TaskInProgress[] tasks = null;
      switch (type) {
        case MAP:
          {
            tasks = maps;
          }
          break;
        case REDUCE:
          {
            tasks = reduces;
          }
          break;
        case JOB_SETUP:
          {
            tasks = setup;
          }
          break;
        case JOB_CLEANUP:
          {
            tasks = cleanup;
          }
          break;
        default:
          {
            tasks = new TaskInProgress[0];
          }
          break;
      }
  
      return tasks;
    }
docs: Get all the tasks of the desired type in this job.
  @param type {@link TaskType} of the tasks required
  @return An array of {@link TaskInProgress} matching the given type.
  Returns an empty array if no tasks are found for the given type.