BigDecimalUtils { public static BigDecimal roundToStepSize(BigDecimal value, BigDecimal stepSize) { return roundToStepSize(value, stepSize, RoundingMode.HALF_DOWN); } private  BigDecimalUtils(); static BigDecimal roundToStepSize(BigDecimal value, BigDecimal stepSize); static BigDecimal roundToStepSize(
      BigDecimal value, BigDecimal stepSize, RoundingMode roundingMode);  }
@Test public void testRoundToStepSize() { BigDecimal result = BigDecimalUtils.roundToStepSize(new BigDecimal("3502.31111111"), new BigDecimal("0.25")); assertThat(result).isEqualByComparingTo("3502.25"); }