/**
   * Filters supported vPools in UnManaged Volume based on Auto-Tiering Policy.
   *
   * @param unManagedVolume the UnManaged volume
   * @param policyName the policy name associated with UnManaged volume
   * @param system the system
   * @param dbClient the db client
   */
  public static void filterSupportedVpoolsBasedOnTieringPolicy(
      UnManagedVolume unManagedVolume, String policyName, StorageSystem system, DbClient dbClient) {

    StringSetMap unManagedVolumeInformation = unManagedVolume.getVolumeInformation();
    StringSet supportedVpoolURIs =
        unManagedVolumeInformation.get(SupportedVolumeInformation.SUPPORTED_VPOOL_LIST.toString());
    List<String> vPoolsToRemove = new ArrayList<String>();
    if (supportedVpoolURIs != null) {
      Iterator<String> itr = supportedVpoolURIs.iterator();
      while (itr.hasNext()) {
        String uri = itr.next();
        VirtualPool vPool = dbClient.queryObject(VirtualPool.class, URI.create(uri));
        if (vPool != null && !vPool.getInactive()) {
          // generate unmanaged volume's policyId
          String autoTierPolicyId =
              NativeGUIDGenerator.generateAutoTierPolicyNativeGuid(
                  system.getNativeGuid(),
                  policyName,
                  NativeGUIDGenerator.getTieringPolicyKeyForSystem(system));
          if (!checkVPoolValidForUnManagedVolumeAutoTieringPolicy(
              vPool, autoTierPolicyId, system)) {
            String msg =
                "Removing vPool %s from SUPPORTED_VPOOL_LIST in UnManagedVolume %s "
                    + "since Auto-tiering Policy %s in UnManaged Volume does not match with vPool's (%s)";
            _log.info(
                String.format(
                    msg,
                    new Object[] {
                      uri, unManagedVolume.getId(), autoTierPolicyId, vPool.getAutoTierPolicyName()
                    }));
            vPoolsToRemove.add(uri);
          }
        } else {
          // remove Inactive vPool URI
          vPoolsToRemove.add(uri);
        }
      }
    }
    for (String uri : vPoolsToRemove) { // UnManagedVolume object is persisted by caller
      supportedVpoolURIs.remove(uri);
    }
  }