### Question:
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);  }### Answer:
@Test public void shouldReturnPositiveValue() { MonetaryAmount money = Money.parse("EUR 2.35"); MonetaryAmount result = operator.apply(money); assertEquals(result.getCurrency(), this.real); assertEquals(result.getNumber().doubleValue(), 2.35); }
@Test public void shouldReturnNegativeValue() { MonetaryAmount money = Money.parse("BHD -1.345"); MonetaryAmount result = operator.apply(money); assertEquals(result.getCurrency(), real); assertEquals(result.getNumber().doubleValue(), -1.345); }
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErroWhenIsNull() { operator.apply(null); fail(); }