### Question:
AppInfoCollector { void storeLastCoordinators(final File outputDir, int numCoordinators, int maxChildActions) { if (numCoordinators == 0) { return; } try { final List<CoordinatorJob> jobs = client.getCoordJobsInfo(null, 0, numCoordinators); for (CoordinatorJob job : jobs) { getCoordJob(outputDir, job.getId(), maxChildActions); } } catch (OozieClientException e) { System.err.printf("Exception occurred during the retrieval of information on the last %d coordinator(s): %s.%n", numCoordinators, e.getMessage()); } } AppInfoCollector(final Configuration hadoopConfig, final DiagOozieClient client);   }### Answer:
@Test public void testStoreCoordinators() throws Exception { final List<CoordinatorJob> coordJobs = Arrays.asList(coordJob); doReturn(coordJobs).when(mockOozieClient).getCoordJobsInfo(null, 0, 1); final String coordId = "0000000-170926142250283-oozie-test-C"; doReturn(coordId).when(coordJob).getId(); doReturn(Job.Status.RUNNING).when(coordJob).getStatus(); doReturn(CoordinatorJob.Execution.FIFO).when(coordJob).getExecutionOrder(); final List<CoordinatorAction> coordinatorActions = Arrays.asList(coordinatorAction); doReturn(CoordinatorAction.Status.KILLED).when(coordinatorAction).getStatus(); doReturn(coordinatorActions).when(coordJob).getActions(); doReturn(coordJob).when(mockOozieClient).getCoordJobInfo(anyString()); doReturn(CoordinatorJob.Timeunit.MINUTE).when(coordJob).getTimeUnit(); appInfoCollector.storeLastCoordinators(testFolder,1,1); final File coordInfoOut = new File(testFolder, coordId + Path.SEPARATOR + "info.txt"); assertTrue(coordInfoOut.exists()); assertFileContains(coordInfoOut, coordId); }