@Test
  public void testGetContainerStorageStats() throws StoreException {
    BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);
    List<Short> allAccountIds =
        state.allKeys.keySet().stream().map(mockId -> mockId.getAccountId()).distinct().collect(Collectors.toList());
    assertFalse(allAccountIds.isEmpty());
    short maxAccountId = allAccountIds.stream().max(Comparator.naturalOrder()).get();
    List<Short> accountIdToExclude = null;

    while (true) {
      long deleteAndExpirationRefTimeInMs = state.time.milliseconds();
      Map<Short, Map<Short, ContainerStorageStats>> statsMap =
          blobStoreStats.getContainerStorageStats(deleteAndExpirationRefTimeInMs);
      Optional.ofNullable(accountIdToExclude).orElse(Collections.EMPTY_LIST).forEach(id -> statsMap.remove(id));

      // Verify account stats snapshot
      Map<Short, Map<Short, ContainerStorageStats>> obtainedStatsMap =
          blobStoreStats.getContainerStorageStats(deleteAndExpirationRefTimeInMs, accountIdToExclude);
      assertEquals(statsMap, obtainedStatsMap);
      if (accountIdToExclude == null) {
        accountIdToExclude = Arrays.asList(allAccountIds.get(0), (short) (maxAccountId + 1));
      } else {
        break;
      }
    }
  }
Test the getContainerStorageStats method by verifying the returned stats against the original quota {@link Map}.
ambry-store/src/test/java/com/github/ambry/store/BlobStoreStatsTest.java