### Question:
PercentOperator implements MonetaryOperator { @Override public MonetaryAmount apply(MonetaryAmount amount) { Objects.requireNonNull(amount, "Amount required."); return amount.multiply(percentValue); } PercentOperator(final BigDecimal decimal); @Override MonetaryAmount apply(MonetaryAmount amount); @Override String toString();  }### Answer:
@Test public void shouldReturnPositiveValue() { CurrencyUnit currency = Monetary.getCurrency("EUR"); MonetaryAmount money = Money.parse("EUR 200.0"); MonetaryAmount result = operator.apply(money); assertEquals(result.getCurrency(), currency); assertEquals(result.getNumber().doubleValue(), 20.0); }
@Test public void shouldReturnNegativeValue() { CurrencyUnit currency = Monetary.getCurrency("BHD"); MonetaryAmount money = Money.parse("BHD -200.0"); MonetaryAmount result = operator.apply(money); assertEquals(result.getCurrency(), currency); assertEquals(result.getNumber().doubleValue(), -20.0); }
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErroWhenIsNull() { operator.apply(null); fail(); }