@Test public void shouldReturnScaleRoundingOperator() { int scale = 6; RoundingMode roundingMode = RoundingMode.HALF_EVEN; MonetaryRoundedFactory factory = MonetaryRoundedFactory .withRoundingMode(roundingMode).withScale(scale) .build(); assertNotNull(factory); MonetaryOperator roundingOperator = factory.getRoundingOperator(); assertNotNull(roundingOperator); assertTrue(ScaleRoundedOperator.class.isInstance(roundingOperator)); ScaleRoundedOperator result = ScaleRoundedOperator.class.cast(roundingOperator); assertEquals(scale, result.getScale()); assertEquals(roundingMode, result.getRoundingMode()); }
public MonetaryRoundedFactoryWithScaleBuilder withScale(int scale) { return new MonetaryRoundedFactoryWithScaleBuilder(roundingMode, scale); }
MonetaryRoundedFactoryBuilder { public MonetaryRoundedFactoryWithScaleBuilder withScale(int scale) { return new MonetaryRoundedFactoryWithScaleBuilder(roundingMode, scale); } }
MonetaryRoundedFactoryBuilder { public MonetaryRoundedFactoryWithScaleBuilder withScale(int scale) { return new MonetaryRoundedFactoryWithScaleBuilder(roundingMode, scale); } MonetaryRoundedFactoryBuilder(RoundingMode roundingMode); }
MonetaryRoundedFactoryBuilder { public MonetaryRoundedFactoryWithScaleBuilder withScale(int scale) { return new MonetaryRoundedFactoryWithScaleBuilder(roundingMode, scale); } MonetaryRoundedFactoryBuilder(RoundingMode roundingMode); MonetaryRoundedFactoryWithScaleBuilder withScale(int scale); MonetaryRoundedFactoryWithPrecisionBuilder withPrecision(int precision); @Override String toString(); }
MonetaryRoundedFactoryBuilder { public MonetaryRoundedFactoryWithScaleBuilder withScale(int scale) { return new MonetaryRoundedFactoryWithScaleBuilder(roundingMode, scale); } MonetaryRoundedFactoryBuilder(RoundingMode roundingMode); MonetaryRoundedFactoryWithScaleBuilder withScale(int scale); MonetaryRoundedFactoryWithPrecisionBuilder withPrecision(int precision); @Override String toString();  }