### Question:
ReconTaskControllerImpl implements ReconTaskController { @Override public synchronized void reInitializeTasks( ReconOMMetadataManager omMetadataManager) throws InterruptedException { try { Collection<Callable<Pair<String, Boolean>>> tasks = new ArrayList<>(); for (Map.Entry<String, ReconOmTask> taskEntry : reconOmTasks.entrySet()) { ReconOmTask task = taskEntry.getValue(); tasks.add(() -> task.reprocess(omMetadataManager)); } List<Future<Pair<String, Boolean>>> results = executorService.invokeAll(tasks); for (Future<Pair<String, Boolean>> f : results) { String taskName = f.get().getLeft(); if (!f.get().getRight()) { LOG.info("Init failed for task {}.", taskName); } else { ReconTaskStatus reconTaskStatusRecord = new ReconTaskStatus(taskName, System.currentTimeMillis(), omMetadataManager.getLastSequenceNumberFromDB()); reconTaskStatusDao.update(reconTaskStatusRecord); } } } catch (ExecutionException e) { LOG.error("Unexpected error : ", e); } } @Inject  ReconTaskControllerImpl(OzoneConfiguration configuration,
                                 ReconTaskStatusDao reconTaskStatusDao,
                                 Set<ReconOmTask> tasks); @Override void registerTask(ReconOmTask task); @Override synchronized void consumeOMEvents(OMUpdateEventBatch events,
                              OMMetadataManager omMetadataManager); @Override synchronized void reInitializeTasks(
      ReconOMMetadataManager omMetadataManager); @Override Map<String, ReconOmTask> getRegisteredTasks(); @Override ReconTaskStatusDao getReconTaskStatusDao(); @Override synchronized void start(); @Override synchronized void stop();  }### Answer:
@Test public void testReInitializeTasks() throws Exception { ReconOMMetadataManager omMetadataManagerMock = mock( ReconOMMetadataManager.class); ReconOmTask reconOmTaskMock = getMockTask("MockTask2"); when(reconOmTaskMock.reprocess(omMetadataManagerMock)) .thenReturn(new ImmutablePair<>("MockTask2", true)); when(omMetadataManagerMock.getLastSequenceNumberFromDB() ).thenReturn(100L); long startTime = System.currentTimeMillis(); reconTaskController.registerTask(reconOmTaskMock); reconTaskController.reInitializeTasks(omMetadataManagerMock); long endTime = System.currentTimeMillis(); verify(reconOmTaskMock, times(1)) .reprocess(omMetadataManagerMock); verify(omMetadataManagerMock, times(1) ).getLastSequenceNumberFromDB(); ReconTaskStatus reconTaskStatus = reconTaskStatusDao.findById("MockTask2"); long taskTimeStamp = reconTaskStatus.getLastUpdatedTimestamp(); long seqNumber = reconTaskStatus.getLastUpdatedSeqNumber(); Assert.assertTrue(startTime <= taskTimeStamp && taskTimeStamp <= endTime); Assert.assertEquals(seqNumber, omMetadataManagerMock.getLastSequenceNumberFromDB()); }