@Override
    public DecimalData next() {
        if (nullRate == 0f || ThreadLocalRandom.current().nextFloat() > nullRate) {
            BigDecimal decimal =
                    new BigDecimal(
                            ThreadLocalRandom.current().nextDouble(min, max),
                            new MathContext(precision, RoundingMode.DOWN));
            return DecimalData.fromBigDecimal(decimal, precision, scale);
        }
        return null;
    }
@Test
    void testMinMax() {
        for (int precision = 1; precision <= 38; precision++) {
            for (int scale = 0; scale <= precision; scale++) {
                BigDecimal min = BigDecimal.valueOf(-10.0);
                BigDecimal max = BigDecimal.valueOf(10.0);

                DecimalDataRandomGenerator gen =
                        new DecimalDataRandomGenerator(
                                precision, scale, min.doubleValue(), max.doubleValue(), 0f);
                DecimalData result = gen.next();

                assertThat(result)
                        .as("Null value for DECIMAL(" + precision + "," + scale + ")")
                        .isNotNull();
                assertThat(result.toBigDecimal())
                        .as("value must be greater than or equal to min")
                        .isGreaterThanOrEqualTo(min)
                        .as("value must be less than or equal to max")
                        .isLessThanOrEqualTo(max);
            }
        }
    }