### Question:
MoneyProducer implements MonetaryAmountProducer { @Override public MonetaryAmount create(CurrencyUnit currency, Number number) { return Money.of(Objects.requireNonNull(number), Objects.requireNonNull(currency)); }  @Override MonetaryAmount create(CurrencyUnit currency, Number number);  }### Answer:
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErrorWhenCurrencyIsNull() { producer.create(null, 10); }
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErrorWhenNumberIsNull() { producer.create(currency, null); }
@Test public void shouldCreateMonetaryAmount() { Long value = 10L; MonetaryAmount amount = producer.create(currency, value); assertEquals(amount.getCurrency(), currency); assertEquals(Long.valueOf(amount.getNumber().longValue()), value); }
@Test public void shouldCreateUsingMoneyImplementation() { Long value = 10L; MonetaryAmount amount = producer.create(currency, value); assertTrue(Money.class.isInstance(amount)); }