public static Collection<QuotaResource> getQuotaResourcesFromAccounts(Collection<Account> accounts) {
    Set<QuotaResource> quotaResources = new HashSet<>();
    accounts.forEach(account -> {
      if (account.getQuotaResourceType() == QuotaResourceType.ACCOUNT) {
        quotaResources.add(QuotaResource.fromAccount(account));
      } else {
        account.getAllContainers().forEach(container -> quotaResources.add(QuotaResource.fromContainer(container)));
      }
    });
    return quotaResources;
  }
Convert a {@link Collection} of {@link Account}s to {@link Collection} of {@link QuotaResource} objects.
@param accounts {@link Collection} of account objects to be converted.
@return Collection of {@link QuotaResource} objects.
ambry-quota/src/main/java/com/github/ambry/quota/QuotaUtils.java