### Question:
CompletedTask implements Task { @Override public synchronized TaskReport getReport() { if (report == null) { constructTaskReport(); } return report; } CompletedTask(TaskId taskId, TaskInfo taskInfo); @Override boolean canCommit(TaskAttemptId taskAttemptID); @Override TaskAttempt getAttempt(TaskAttemptId attemptID); @Override Map<TaskAttemptId, TaskAttempt> getAttempts(); @Override Counters getCounters(); @Override TaskId getID(); @Override float getProgress(); @Override synchronized TaskReport getReport(); @Override TaskType getType(); @Override boolean isFinished(); @Override TaskState getState();  }### Answer:
@Test public void testTaskStartTimes() { TaskId taskId = Mockito.mock(TaskId.class); TaskInfo taskInfo = Mockito.mock(TaskInfo.class); Map<TaskAttemptID, TaskAttemptInfo> taskAttempts = new TreeMap<TaskAttemptID, TaskAttemptInfo>(); TaskAttemptID id = new TaskAttemptID("0", 0, TaskType.MAP, 0, 0); TaskAttemptInfo info = Mockito.mock(TaskAttemptInfo.class); Mockito.when(info.getAttemptId()).thenReturn(id); Mockito.when(info.getStartTime()).thenReturn(10l); taskAttempts.put(id, info); id = new TaskAttemptID("1", 0, TaskType.MAP, 1, 1); info = Mockito.mock(TaskAttemptInfo.class); Mockito.when(info.getAttemptId()).thenReturn(id); Mockito.when(info.getStartTime()).thenReturn(20l); taskAttempts.put(id, info); Mockito.when(taskInfo.getAllTaskAttempts()).thenReturn(taskAttempts); CompletedTask task = new CompletedTask(taskId, taskInfo); TaskReport report = task.getReport(); Assert.assertTrue(report.getStartTime() == 10); }