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

  public Money convertedTo(Currency resultCurrency, BigDecimal fxRate) {
    if (currency.equals(resultCurrency)) {
      if (DoubleMath.fuzzyEquals(fxRate.doubleValue(), 1d, 1e-8)) {
        return this;
      }
      throw new IllegalArgumentException("FX rate must be 1 when no conversion required");
    }
    return Money.of(resultCurrency, amount.multiply(fxRate));
  }

  private  Money(Currency currency, BigDecimal amount);

}