@Test public void shouldCreateMonetaryAmount() { Long value = 10L; MonetaryAmount amount = producer.create(currency, value); assertEquals(amount.getCurrency(), currency); assertEquals(Long.valueOf(amount.getNumber().longValue()), value); }
@Override public MonetaryAmount create(CurrencyUnit currency, Number number) { return RoundedMoney.of(Objects.requireNonNull(number), Objects.requireNonNull(currency), operator); }
RoundedMoneyProducer implements MonetaryAmountProducer { @Override public MonetaryAmount create(CurrencyUnit currency, Number number) { return RoundedMoney.of(Objects.requireNonNull(number), Objects.requireNonNull(currency), operator); } }
RoundedMoneyProducer implements MonetaryAmountProducer { @Override public MonetaryAmount create(CurrencyUnit currency, Number number) { return RoundedMoney.of(Objects.requireNonNull(number), Objects.requireNonNull(currency), operator); } RoundedMoneyProducer(MonetaryOperator operator);  RoundedMoneyProducer(); }
RoundedMoneyProducer implements MonetaryAmountProducer { @Override public MonetaryAmount create(CurrencyUnit currency, Number number) { return RoundedMoney.of(Objects.requireNonNull(number), Objects.requireNonNull(currency), operator); } RoundedMoneyProducer(MonetaryOperator operator);  RoundedMoneyProducer(); @Override MonetaryAmount create(CurrencyUnit currency, Number number); MonetaryOperator getOperator(); }
RoundedMoneyProducer implements MonetaryAmountProducer { @Override public MonetaryAmount create(CurrencyUnit currency, Number number) { return RoundedMoney.of(Objects.requireNonNull(number), Objects.requireNonNull(currency), operator); } RoundedMoneyProducer(MonetaryOperator operator);  RoundedMoneyProducer(); @Override MonetaryAmount create(CurrencyUnit currency, Number number); MonetaryOperator getOperator();  }