### Question:
ScaleRoundedOperator implements MonetaryOperator { public static ScaleRoundedOperator of(int scale, RoundingMode roundingMode) { Objects.requireNonNull(roundingMode); if(RoundingMode.UNNECESSARY.equals(roundingMode)) { throw new IllegalStateException("To create the ScaleRoundedOperator you cannot use the RoundingMode.UNNECESSARY"); } return new ScaleRoundedOperator(scale, roundingMode); } private  ScaleRoundedOperator(int scale, RoundingMode roundingMode); static ScaleRoundedOperator of(int scale, RoundingMode roundingMode); @Override MonetaryAmount apply(MonetaryAmount amount); int getScale(); RoundingMode getRoundingMode(); @Override String toString();  }### Answer:
@Test(expectedExceptions = NullPointerException.class) public void shouldReturnNullPointerExceptionWhenParameterIsNull() { ScaleRoundedOperator.of(0, null); fail(); }
@Test(expectedExceptions = IllegalStateException.class) public void shouldReturnErrorWhenScaleIsUNNECESSARY() { ScaleRoundedOperator.of(0, RoundingMode.UNNECESSARY); fail(); }