### Question:
ContainerKeyMapperTask implements ReconOmTask { @Override public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) { long omKeyCount = 0; try { LOG.info("Starting a 'reprocess' run of ContainerKeyMapperTask."); Instant start = Instant.now(); containerDBServiceProvider.initNewContainerDB(new HashMap<>()); Table<String, OmKeyInfo> omKeyInfoTable = omMetadataManager.getKeyTable(); try (TableIterator<String, ? extends Table.KeyValue<String, OmKeyInfo>> keyIter = omKeyInfoTable.iterator()) { while (keyIter.hasNext()) { Table.KeyValue<String, OmKeyInfo> kv = keyIter.next(); OmKeyInfo omKeyInfo = kv.getValue(); writeOMKeyToContainerDB(kv.getKey(), omKeyInfo); omKeyCount++; } } LOG.info("Completed 'reprocess' of ContainerKeyMapperTask."); Instant end = Instant.now(); long duration = Duration.between(start, end).toMillis(); LOG.info("It took me {} seconds to process {} keys.", (double) duration / 1000.0, omKeyCount); } catch (IOException ioEx) { LOG.error("Unable to populate Container Key Prefix data in Recon DB. ", ioEx); return new ImmutablePair<>(getTaskName(), false); } return new ImmutablePair<>(getTaskName(), true); } @Inject  ContainerKeyMapperTask(ContainerDBServiceProvider
                                    containerDBServiceProvider); @Override Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager); @Override String getTaskName(); @Override Collection<String> getTaskTables(); @Override Pair<String, Boolean> process(OMUpdateEventBatch events);  }### Answer:
@Test public void testReprocessOMDB() throws Exception{ Map<ContainerKeyPrefix, Integer> keyPrefixesForContainer = containerDbServiceProvider.getKeyPrefixesForContainer(1); assertTrue(keyPrefixesForContainer.isEmpty()); keyPrefixesForContainer = containerDbServiceProvider .getKeyPrefixesForContainer(2); assertTrue(keyPrefixesForContainer.isEmpty()); Pipeline pipeline = getRandomPipeline(); List<OmKeyLocationInfo> omKeyLocationInfoList = new ArrayList<>(); BlockID blockID1 = new BlockID(1, 1); OmKeyLocationInfo omKeyLocationInfo1 = getOmKeyLocationInfo(blockID1, pipeline); BlockID blockID2 = new BlockID(2, 1); OmKeyLocationInfo omKeyLocationInfo2 = getOmKeyLocationInfo(blockID2, pipeline); omKeyLocationInfoList.add(omKeyLocationInfo1); omKeyLocationInfoList.add(omKeyLocationInfo2); OmKeyLocationInfoGroup omKeyLocationInfoGroup = new OmKeyLocationInfoGroup(0, omKeyLocationInfoList); writeDataToOm(reconOMMetadataManager, "key_one", "bucketOne", "sampleVol", Collections.singletonList(omKeyLocationInfoGroup)); ContainerKeyMapperTask containerKeyMapperTask = new ContainerKeyMapperTask(containerDbServiceProvider); containerKeyMapperTask.reprocess(reconOMMetadataManager); keyPrefixesForContainer = containerDbServiceProvider.getKeyPrefixesForContainer(1); assertEquals(1, keyPrefixesForContainer.size()); String omKey = omMetadataManager.getOzoneKey("sampleVol", "bucketOne", "key_one"); ContainerKeyPrefix containerKeyPrefix = new ContainerKeyPrefix(1, omKey, 0); assertEquals(1, keyPrefixesForContainer.get(containerKeyPrefix).intValue()); keyPrefixesForContainer = containerDbServiceProvider.getKeyPrefixesForContainer(2); assertEquals(1, keyPrefixesForContainer.size()); containerKeyPrefix = new ContainerKeyPrefix(2, omKey, 0); assertEquals(1, keyPrefixesForContainer.get(containerKeyPrefix).intValue()); assertEquals(1, containerDbServiceProvider.getKeyCountForContainer(1L)); assertEquals(1, containerDbServiceProvider.getKeyCountForContainer(2L)); assertEquals(0, containerDbServiceProvider.getKeyCountForContainer(3L)); assertEquals(2, containerDbServiceProvider.getCountForContainers()); }