code: private java.util.Map<JobHistory.Keys, String> getLastSuccessfulTaskAttempt(JobHistory.Task task) {
      
      Map<String, JobHistory.TaskAttempt> taskAttempts = task.getTaskAttempts();
      int size = taskAttempts.size();
      java.util.Iterator<Map.Entry<String, JobHistory.TaskAttempt>> kv = taskAttempts.entrySet().iterator();
      for (int i=0; i<size; i++) {
        // CHECK_IT: Only one SUCCESSFUL TASK ATTEMPT
        Map.Entry<String, JobHistory.TaskAttempt> tae = kv.next();
        JobHistory.TaskAttempt attempt = tae.getValue();
        if (attempt.getValues().get(JobHistory.Keys.TASK_STATUS).equals("SUCCESS")) {
          return attempt.getValues();
        }
      }
      
      return null;
    }
docs: /*
  Get last successful task attempt to be added in the stats