### Question:
MonetaryOperators { public static MonetaryOperator rounding() { return ROUNDING_MONETARY_AMOUNT; } private  MonetaryOperators(); static MonetaryOperator reciprocal(); static MonetaryOperator permil(BigDecimal decimal); static MonetaryOperator permil(Number number); static MonetaryOperator permil(Number number, MathContext mathContext); static MonetaryOperator percent(BigDecimal decimal); static MonetaryOperator percent(Number number); static MonetaryOperator minorPart(); static MonetaryOperator majorPart(); static MonetaryOperator rounding(); static MonetaryOperator rounding(RoundingMode roundingMode); static MonetaryOperator rounding(RoundingMode roundingMode, int scale); static MonetaryOperator rounding(int scale);  }### Answer:
@Test public void shouldRounding() { CurrencyUnit euro = Monetary.getCurrency("EUR"); MonetaryAmount money = Money.parse("EUR 2.355432"); MonetaryAmount result = MonetaryOperators.rounding().apply(money); assertNotNull(result); assertEquals(result.getCurrency(), euro); assertEquals(2.36d, result.getNumber().doubleValue()); }
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErrorWhenRoundingTypeIsNull() { MonetaryAmount money = Money.parse("EUR 2.355432"); MonetaryOperators.rounding(null).apply(money); }
@Test public void shouldRoundingUsingRoundingMode() { CurrencyUnit euro = Monetary.getCurrency("EUR"); MonetaryAmount money = Money.parse("EUR 2.355432"); MonetaryAmount result = MonetaryOperators.rounding(RoundingMode.HALF_EVEN).apply(money); assertNotNull(result); assertEquals(result.getCurrency(), euro); assertEquals(2.36d, result.getNumber().doubleValue()); }
@Test public void shouldRoundingUsingRoundingModeAndScale() { CurrencyUnit euro = Monetary.getCurrency("EUR"); MonetaryAmount money = Money.parse("EUR 2.355432"); MonetaryAmount result = MonetaryOperators.rounding(RoundingMode.HALF_EVEN, 4).apply(money); assertNotNull(result); assertEquals(result.getCurrency(), euro); assertEquals(2.3554d, result.getNumber().doubleValue()); }
@Test public void shouldRoundingUsingScale() { CurrencyUnit euro = Monetary.getCurrency("EUR"); MonetaryAmount money = Money.parse("EUR 2.355432"); MonetaryAmount result = MonetaryOperators.rounding(4).apply(money); assertNotNull(result); assertEquals(result.getCurrency(), euro); assertEquals(2.3554d, result.getNumber().doubleValue()); }