@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErroWhenIsNull() { operator.apply(null); fail(); }
@Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.getFactory().setCurrency(currency).create(); }
ExchangeCurrencyOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.getFactory().setCurrency(currency).create(); } }
ExchangeCurrencyOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.getFactory().setCurrency(currency).create(); } ExchangeCurrencyOperator(CurrencyUnit currency); }
ExchangeCurrencyOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.getFactory().setCurrency(currency).create(); } ExchangeCurrencyOperator(CurrencyUnit currency); @Override MonetaryAmount apply(MonetaryAmount amount); }
ExchangeCurrencyOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.getFactory().setCurrency(currency).create(); } ExchangeCurrencyOperator(CurrencyUnit currency); @Override MonetaryAmount apply(MonetaryAmount amount);  }