public static org.apache.hadoop.mapred.JobID fromYarn(JobId id) {
    String identifier = fromClusterTimeStamp(id.getAppId().getClusterTimestamp());
    return new org.apache.hadoop.mapred.JobID(identifier, id.getId());
  }
@Test
  public void testEnums() throws Exception {
    for (YarnApplicationState applicationState : YarnApplicationState.values()) {
      TypeConverter.fromYarn(applicationState, FinalApplicationStatus.FAILED);
    }
    // ad hoc test of NEW_SAVING, which is newly added
    assertEquals(State.PREP, TypeConverter.fromYarn(
        YarnApplicationState.NEW_SAVING, FinalApplicationStatus.FAILED));

    for (TaskType taskType : TaskType.values()) {
      TypeConverter.fromYarn(taskType);
    }

    for (JobState jobState : JobState.values()) {
      TypeConverter.fromYarn(jobState);
    }

    for (QueueState queueState : QueueState.values()) {
      TypeConverter.fromYarn(queueState);
    }

    for (TaskState taskState : TaskState.values()) {
      TypeConverter.fromYarn(taskState);
    }
  }