/**
   * @param claimMappings
   * @return
   */
  public static Map<String, String> getClaimMappings(
      ClaimMapping[] claimMappings, boolean useLocalDialectAsKey) {

    Map<String, String> remoteToLocalClaimMap = new HashMap<String, String>();

    for (ClaimMapping claimMapping : claimMappings) {
      if (useLocalDialectAsKey) {
        remoteToLocalClaimMap.put(
            claimMapping.getLocalClaim().getClaimUri(),
            claimMapping.getRemoteClaim().getClaimUri());
      } else {
        remoteToLocalClaimMap.put(
            claimMapping.getRemoteClaim().getClaimUri(),
            claimMapping.getLocalClaim().getClaimUri());
      }
    }
    return remoteToLocalClaimMap;
  }
  /**
   * @param claimMappings
   * @param useLocalDialectAsKey
   * @return
   */
  public static Map<String, String> getClaimMappings(
      Map<ClaimMapping, String> claimMappings, boolean useLocalDialectAsKey) {

    Map<String, String> remoteToLocalClaimMap = new HashMap<String, String>();

    for (Entry<ClaimMapping, String> entry : claimMappings.entrySet()) {
      ClaimMapping claimMapping = entry.getKey();
      if (useLocalDialectAsKey) {
        remoteToLocalClaimMap.put(claimMapping.getLocalClaim().getClaimUri(), entry.getValue());
      } else {
        remoteToLocalClaimMap.put(claimMapping.getRemoteClaim().getClaimUri(), entry.getValue());
      }
    }
    return remoteToLocalClaimMap;
  }