/** * Assert that the {@code CurrencyAmount} is of the expected currency. * * @param ccy the expected currency * @return this if the currency matches the expectation, else * throw an {@code AssertionError} */ public CurrencyAmountAssert hasCurrency(Currency ccy) { isNotNull(); if (!actual.getCurrency().equals(ccy)) { failWithMessage("Expected CurrencyAmount with currency: <%s> but was: <%s>", ccy, actual.getCurrency()); } return this; }