class CurrencyAmount implements FxConvertible<CurrencyAmount>, Comparable<CurrencyAmount>, Serializable {

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      CurrencyAmount other = (CurrencyAmount) obj;
      return currency.equals(other.currency) &&
          JodaBeanUtils.equal(amount, other.amount);
    }
    return false;
  }

  private  CurrencyAmount(Currency currency, double amount);

}