@Test
public void testHashCode() {

  TaskType[] types = TaskType.values();
  for (int i = 0; i < types.length; i++) {
    JobID jobId = new JobID("1234" + i, i);
    TaskID taskId1 = new TaskID(jobId, types[i], i);
    TaskID taskId2 = new TaskID(jobId, types[i], i);
    assertTrue("The hashcode() method gave unequal hash codes for two equal "
        + "task IDs", taskId1.hashCode() == taskId2.hashCode());
  }
}