code: public static BigDecimal roundToClosest(double value, double steps) {
          final BigDecimal down = DMatrixUtils.roundDownTo(value, steps);
          final BigDecimal up = DMatrixUtils.roundUpTo(value, steps);
          final BigDecimal orig = new BigDecimal(String.valueOf(value));
          if (orig.subtract(down).abs().compareTo(orig.subtract(up).abs()) < 0) {
              return down;
          }
          return up;
      }
docs: Returns the closest rounded value of the given value for the given steps.
  
  @param value The original value to be rounded.
  @param steps The steps.
  @return The closest rounded value of the given value for the given steps.