class CurrencyAmount implements ImmutableBean, Serializable {

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

  @ImmutableConstructor private  CurrencyAmount(final Currency currency, final double amount);

}