### Question:
MRApps extends Apps { public static TaskAttemptId toTaskAttemptID(String taid) { Iterator<String> it = _split(taid).iterator(); TaskId tid = toTaskID(ATTEMPT, taid, it); shouldHaveNext(ATTEMPT, taid, it); TaskAttemptId taId = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(TaskAttemptId.class); taId.setTaskId(tid); taId.setId(Integer.parseInt(it.next())); return taId; }  static String toString(JobId jid); static JobId toJobID(String jid); static JobId toJobID(String prefix, String s, Iterator<String> it); static String toString(TaskId tid); static TaskId toTaskID(String tid); static TaskId toTaskID(String prefix, String s, Iterator<String> it); static String toString(TaskAttemptId taid); static TaskAttemptId toTaskAttemptID(String taid); static String taskSymbol(TaskType type); static TaskType taskType(String symbol); static TaskAttemptStateUI taskAttemptState(String attemptStateStr); static void setInitialClasspath(
      Map<String, String> environment); static void addToClassPath(
      Map<String, String> environment, String fileName); static Path getStagingAreaDir(Configuration conf, String user); static String getJobFile(Configuration conf, String user, 
      org.apache.hadoop.mapreduce.JobID jobId); static final String JOB; static final String TASK; static final String ATTEMPT; static final String CLASSPATH; }### Answer:
@Test public void testToTaskAttemptID() { TaskAttemptId taid = MRApps.toTaskAttemptID("attempt_0_1_2_m_3_4"); assertEquals(0, taid.getTaskId().getJobId().getAppId().getClusterTimestamp()); assertEquals(1, taid.getTaskId().getJobId().getAppId().getId()); assertEquals(2, taid.getTaskId().getJobId().getId()); assertEquals(3, taid.getTaskId().getId()); assertEquals(4, taid.getId()); }
@Test(expected=YarnException.class) public void testTaskAttemptIDShort() { MRApps.toTaskAttemptID("attempt_0_0_0_m_0"); }