CurrencyAmount implements ImmutableBean, Serializable { public CurrencyAmount plus(final CurrencyAmount amountToAdd) { ArgumentChecker.notNull(amountToAdd, "amountToAdd"); ArgumentChecker.isTrue(amountToAdd.getCurrency().equals(_currency), "Unable to add amounts in different currencies"); return plus(amountToAdd.getAmount()); } @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(expectedExceptions = IllegalArgumentException.class) public void test_plus_addNullOther() { CCY_AMOUNT.plus(null); }