class BigDecimalUtils {

  private BigDecimalUtils() {}

  public static BigDecimal roundToStepSize(BigDecimal value, BigDecimal stepSize) {
    return roundToStepSize(value, stepSize, RoundingMode.HALF_DOWN);
  }

  public static BigDecimal roundToStepSize(
      BigDecimal value, BigDecimal stepSize, RoundingMode roundingMode) {<FILL_FUNCTION_BODY>}
}

    BigDecimal divided = value.divide(stepSize, MathContext.DECIMAL64).setScale(0, roundingMode);
    return divided.multiply(stepSize, MathContext.DECIMAL64).stripTrailingZeros();
  
<no_super_class>