### Question:
MonetaryOperators { public static MonetaryOperator majorPart() { return EXTRACTOR_MAJOR_PART; } 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 testMajorPart() { MonetaryAmount m = Monetary.getDefaultAmountFactory() .setCurrency( "CHF").setNumber(new BigDecimal( "1234.56789")).create(); MonetaryAmount r = m.with(MonetaryOperators.majorPart()); assertEquals( Monetary.getDefaultAmountFactory().setCurrency( "CHF").setNumber(new BigDecimal("1234")).create(), r); }
@Test(expectedExceptions = NullPointerException.class) public void testMajorPart_Null() { MonetaryOperators.majorPart().apply(null); }