private void initMap(Map<String, Map<String, Long>> mapWithValue, Map<QuotaResource, Long> mapToInit) {
    for (Map.Entry<String, Map<String, Long>> mapEntry : mapWithValue.entrySet()) {
      Account account = accountService.getAccountById(Short.valueOf(mapEntry.getKey()));
      if (account != null) {
        if (account.getQuotaResourceType() == QuotaResourceType.ACCOUNT) {
          // Put this in account storage usage
          long accountUsage = mapEntry.getValue().values().stream().mapToLong(Long::longValue).sum();
          mapToInit.put(QuotaResource.fromAccount(account), accountUsage);
        } else {
          for (Map.Entry<String, Long> innerMapEntry : mapEntry.getValue().entrySet()) {
            // Replace the value in the map anyway.
            Container container = account.getContainerById(Short.valueOf(innerMapEntry.getKey()));
            if (container != null) {
              mapToInit.put(QuotaResource.fromContainer(container), innerMapEntry.getValue());
            }
          }
        }
      }
    }
  }
Initialize the map with another given map and replace the value in the map with the value from given map.
@param mapWithValue The given map used to initialize a different map.
@param mapToInit The storage usage map to be initialized.
ambry-quota/src/main/java/com/github/ambry/quota/storage/StorageQuotaEnforcer.java