### Question:
Cash implements CurrencyAmount { @Override public CurrencyAmount subtract(final CurrencyAmount money) { if (!money.getCurrency().equals(currency)) { throw new IllegalArgumentException("You cannot add " + money.getCurrency() + " with " + currency); } return new Cash(currency, BigDecimalUtil.subtract(amount, money.getAmount())); } Cash(final String currency, final BigDecimal amount); static Cash of(final String currency, final BigDecimal amount); static Cash of(final String currency, final String amount); static Cash of(final String currency, final long amount); @Override String getCurrency(); @Override BigDecimal getAmount(); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override CurrencyAmount negate(); @Override CurrencyAmount add(final CurrencyAmount money); @Override CurrencyAmount subtract(final CurrencyAmount money);  }### Answer:
@Test public void testSubtract() { final Cash money = Cash.of("USD", 1L); final Cash money2 = Cash.of("USD", 10L); final CurrencyAmount money3 = money.subtract(money2); assertThat(money3).isNotSameAs(money); assertThat(money3).isEqualTo(Cash.of("USD", -9L)); final CurrencyAmount money4 = money2.subtract(money); assertThat(money4).isNotSameAs(money); assertThat(money4).isEqualTo(Cash.of("USD", 9)); }