class UnorderedCurrencyPair implements ImmutableBean,
    UniqueIdentifiable, ObjectIdentifiable, Serializable {

  @FromString
  public static UnorderedCurrencyPair parse(final String pairStr) {
    ArgumentChecker.notNull(pairStr, "pairStr");
    if (pairStr.length() != 6) {
      throw new IllegalArgumentException("Unable to parse amount, invalid format: " + pairStr);
    }
    try {
      Currency cur1 = Currency.parse(pairStr.substring(0, 3));
      Currency cur2 = Currency.parse(pairStr.substring(3));
      return new UnorderedCurrencyPair(cur1, cur2);
    } catch (RuntimeException ex) {
      throw new IllegalArgumentException("Unable to parse pair: " + pairStr, ex);
    }
  }

  @ImmutableConstructor private  UnorderedCurrencyPair(Currency currency1, Currency currency2);

}