### Question:
ContainerDBServiceProviderImpl implements ContainerDBServiceProvider { @Override public void initNewContainerDB(Map<ContainerKeyPrefix, Integer> containerKeyPrefixCounts) throws IOException { File oldDBLocation = containerDbStore.getDbLocation(); try { containerDbStore.close(); } catch (Exception e) { LOG.warn("Unable to close old Recon container key DB at {}.", containerDbStore.getDbLocation().getAbsolutePath()); } containerDbStore = getNewDBStore(configuration); LOG.info("Creating new Recon Container DB at {}", containerDbStore.getDbLocation().getAbsolutePath()); initializeTables(); if (oldDBLocation.exists()) { LOG.info("Cleaning up old Recon Container key DB at {}.", oldDBLocation.getAbsolutePath()); FileUtils.deleteDirectory(oldDBLocation); } if (containerKeyPrefixCounts != null) { for (Map.Entry<ContainerKeyPrefix, Integer> entry : containerKeyPrefixCounts.entrySet()) { containerKeyTable.put(entry.getKey(), entry.getValue()); } } storeContainerCount(0L); } @Inject  ContainerDBServiceProviderImpl(DBStore dbStore,
                                        Configuration sqlConfiguration); @Override void close(); @Override void initNewContainerDB(Map<ContainerKeyPrefix, Integer>
                                     containerKeyPrefixCounts); @Override void storeContainerKeyMapping(ContainerKeyPrefix containerKeyPrefix,
                                       Integer count); @Override void storeContainerKeyCount(Long containerID, Long count); @Override long getKeyCountForContainer(Long containerID); @Override boolean doesContainerExists(Long containerID); @Override Integer getCountForContainerKeyPrefix(
      ContainerKeyPrefix containerKeyPrefix); @Override Map<ContainerKeyPrefix, Integer> getKeyPrefixesForContainer(
      long containerId); @Override Map<ContainerKeyPrefix, Integer> getKeyPrefixesForContainer(
      long containerId, String prevKeyPrefix); @Override Map<Long, ContainerMetadata> getContainers(int limit,
                                                    long prevContainer); @Override void deleteContainerMapping(ContainerKeyPrefix containerKeyPrefix); @Override long getCountForContainers(); @Override TableIterator getContainerTableIterator(); @Override void storeContainerCount(Long count); @Override void incrementContainerCountBy(long count);  }### Answer:
@Test public void testInitNewContainerDB() throws Exception { long containerId = System.currentTimeMillis(); Map<ContainerKeyPrefix, Integer> prefixCounts = new HashMap<>(); ContainerKeyPrefix ckp1 = new ContainerKeyPrefix(containerId, "V1/B1/K1", 0); prefixCounts.put(ckp1, 1); ContainerKeyPrefix ckp2 = new ContainerKeyPrefix(containerId, "V1/B1/K2", 0); prefixCounts.put(ckp2, 2); ContainerKeyPrefix ckp3 = new ContainerKeyPrefix(containerId, "V1/B2/K3", 0); prefixCounts.put(ckp3, 3); for (ContainerKeyPrefix prefix : prefixCounts.keySet()) { containerDbServiceProvider.storeContainerKeyMapping( prefix, prefixCounts.get(prefix)); } assertEquals(1, containerDbServiceProvider .getCountForContainerKeyPrefix(ckp1).intValue()); prefixCounts.clear(); prefixCounts.put(ckp2, 12); prefixCounts.put(ckp3, 13); ContainerKeyPrefix ckp4 = new ContainerKeyPrefix(containerId, "V1/B3/K1", 0); prefixCounts.put(ckp4, 14); ContainerKeyPrefix ckp5 = new ContainerKeyPrefix(containerId, "V1/B3/K2", 0); prefixCounts.put(ckp5, 15); containerDbServiceProvider.initNewContainerDB(prefixCounts); Map<ContainerKeyPrefix, Integer> keyPrefixesForContainer = containerDbServiceProvider.getKeyPrefixesForContainer(containerId); assertEquals(4, keyPrefixesForContainer.size()); assertEquals(12, keyPrefixesForContainer.get(ckp2).intValue()); assertEquals(13, keyPrefixesForContainer.get(ckp3).intValue()); assertEquals(14, keyPrefixesForContainer.get(ckp4).intValue()); assertEquals(15, keyPrefixesForContainer.get(ckp5).intValue()); assertEquals(0, containerDbServiceProvider .getCountForContainerKeyPrefix(ckp1).intValue()); }