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); static CurrencyAmount of(final Currency currency, final double amount); static CurrencyAmount of(final String currencyCode, final double amount); @FromString static CurrencyAmount parse(final String amountStr); Currency getCurrency(); double getAmount(); CurrencyAmount plus(final CurrencyAmount amountToAdd); CurrencyAmount plus(final double amountToAdd); CurrencyAmount multipliedBy(final double valueToMultiplyBy); @Override @ToString String toString(); static CurrencyAmount.Meta meta(); @Override CurrencyAmount.Meta metaBean(); @Override Property<R> property(String propertyName); @Override Set<String> propertyNames(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEqualsRubbish() { assertFalse(CCY_AMOUNT.equals("")); assertFalse(CCY_AMOUNT.equals(null)); }