### Question:
DefaultMonetaryRoundedFactory implements MonetaryRoundedFactory { @Override public MonetaryAmount create(Number number, CurrencyUnit currencyUnit) { return RoundedMoney.of(requireNonNull(number), requireNonNull(currencyUnit), roundingOperator); } DefaultMonetaryRoundedFactory(MonetaryOperator roundingOperator); @Override MonetaryAmount create(Number number, CurrencyUnit currencyUnit); @Override MonetaryOperator getRoundingOperator(); @Override String toString();  }### Answer:
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErrorWhenCreateWithNumberNull() { factory.create(null, real); fail(); }
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErrorWhenCreateWithCurrencyUnitNull() { factory.create(20, null); fail(); }
@Test public void shouldCreateMonetaryAmount() { MonetaryAmount monetaryAmount = factory.create(BigDecimal.TEN, real); assertNotNull(monetaryAmount); assertTrue(RoundedMoney.class.isInstance(monetaryAmount)); RoundedMoney roundedMoney = RoundedMoney.class.cast(monetaryAmount); assertEquals(real, roundedMoney.getCurrency()); assertEquals(BigDecimal.TEN, roundedMoney.getNumber().numberValue(BigDecimal.class)); }