### Question:
MonetaryOperators { public static MonetaryOperator permil(BigDecimal decimal) { return new PermilOperator(decimal); } 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 testPermilBigDecimal() { MonetaryAmount m = Monetary.getDefaultAmountFactory() .setCurrency( "CHF").setNumber(100).create(); MonetaryAmount r = m.with(MonetaryOperators.permil(BigDecimal .valueOf(25))); assertEquals( Monetary.getDefaultAmountFactory().setCurrency("CHF") .setNumber( new BigDecimal("2.5")).create(), r); }
@Test public void testPermilNumber() { MonetaryAmount m = Monetary.getDefaultAmountFactory() .setCurrency( "CHF").setNumber(100).create(); MonetaryAmount r = m.with(MonetaryOperators.permil(25)); assertEquals( Monetary.getDefaultAmountFactory().setCurrency("CHF") .setNumber( new BigDecimal("2.5")).create(), r); }
@Test public void testPermilNumberMathContext() { MonetaryAmount m = Monetary.getDefaultAmountFactory() .setCurrency( "CHF").setNumber(100).create(); MonetaryAmount r = m.with(MonetaryOperators.permil(25, MathContext.DECIMAL64)); assertEquals( Monetary.getDefaultAmountFactory().setCurrency("CHF") .setNumber( new BigDecimal("2.5")).create(), r); }
@Test(expectedExceptions = NullPointerException.class) public void testPermil_Null1() { MonetaryOperators.permil(null); }
@Test(expectedExceptions = NullPointerException.class) public void testPermil_Null2() { MonetaryOperators.permil(1).apply(null); }