### Question:
MRApps extends Apps { public static String toString(JobId jid) { return jid.toString(); }  static String toString(JobId jid); static JobId toJobID(String jid); static String toString(TaskId tid); static TaskId toTaskID(String tid); 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 TaskStateUI taskState(String taskStateStr); @SuppressWarnings("deprecation") static void setClasspath(Map<String, String> environment,
      Configuration conf); static void setJobClassLoader(Configuration conf); static ClassLoader createJobClassLoader(Configuration conf); static void setClassLoader(ClassLoader classLoader,
      Configuration conf); static Path getStagingAreaDir(Configuration conf, String user); static String getJobFile(Configuration conf, String user, 
      org.apache.hadoop.mapreduce.JobID jobId); static Path getEndJobCommitSuccessFile(Configuration conf, String user,
      JobId jobId); static Path getEndJobCommitFailureFile(Configuration conf, String user,
      JobId jobId); static Path getStartJobCommitFile(Configuration conf, String user,
      JobId jobId); static void setupDistributedCache( 
      Configuration conf, 
      Map<String, LocalResource> localResources); static void addLog4jSystemProperties(
      String logLevel, long logSize, int numBackups, List<String> vargs); static String getSystemPropertiesToLog(Configuration conf); static void setEnvFromInputString(Map<String, String> env,
      String envString, Configuration conf); @Public @Unstable static void addToEnvironment(Map<String, String> environment,
      String variable, String value, Configuration conf); static String crossPlatformifyMREnv(Configuration conf, Environment env); static final Log LOG; }### Answer:
@Test (timeout = 120000) public void testTaskAttemptIDtoString() { TaskAttemptId taid = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(TaskAttemptId.class); taid.setTaskId(RecordFactoryProvider.getRecordFactory(null).newRecordInstance(TaskId.class)); taid.getTaskId().setTaskType(TaskType.MAP); taid.getTaskId().setJobId(RecordFactoryProvider.getRecordFactory(null).newRecordInstance(JobId.class)); taid.getTaskId().getJobId().setAppId(ApplicationId.newInstance(0, 0)); assertEquals("attempt_0_0000_m_000000_0", MRApps.toString(taid)); }
@Test (timeout = 120000) public void testJobIDtoString() { JobId jid = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(JobId.class); jid.setAppId(ApplicationId.newInstance(0, 0)); assertEquals("job_0_0000", MRApps.toString(jid)); }
@Test (timeout = 120000) public void testTaskIDtoString() { TaskId tid = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(TaskId.class); tid.setJobId(RecordFactoryProvider.getRecordFactory(null).newRecordInstance(JobId.class)); tid.getJobId().setAppId(ApplicationId.newInstance(0, 0)); tid.setTaskType(TaskType.MAP); TaskType type = tid.getTaskType(); System.err.println(type); type = TaskType.REDUCE; System.err.println(type); System.err.println(tid.getTaskType()); assertEquals("task_0_0000_m_000000", MRApps.toString(tid)); tid.setTaskType(TaskType.REDUCE); assertEquals("task_0_0000_r_000000", MRApps.toString(tid)); }