### Question:
MonetaryOperators { public static MonetaryOperator percent(BigDecimal decimal) { return new PercentOperator(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 testPercentBigDecimal() { MonetaryAmount m = Monetary.getDefaultAmountFactory() .setCurrency( "CHF").setNumber(100L).create(); MonetaryAmount r = m.with(MonetaryOperators.percent(BigDecimal .valueOf(25))); assertEquals( Monetary.getDefaultAmountFactory().setCurrency("CHF") .setNumber( new BigDecimal("25")).create(), r); }
@Test public void testPercentNumber() { MonetaryAmount m = Monetary.getDefaultAmountFactory() .setCurrency( "CHF").setNumber(100).create(); MonetaryAmount r = m.with(MonetaryOperators.percent((long) 25)); assertEquals( Monetary.getDefaultAmountFactory().setCurrency("CHF") .setNumber( new BigDecimal("25")).create(), r); }
@Test public void testPercentToString() { MonetaryOperator p = MonetaryOperators.percent((short) 25); assertTrue(p.toString().contains("25")); assertTrue(p.toString().contains("%")); }
@Test(expectedExceptions = NullPointerException.class) public void testPercent_Null1() { MonetaryOperators.percent(null); }
@Test(expectedExceptions = NullPointerException.class) public void testPercent_Null2() { MonetaryOperators.percent(1).apply(null); }