public static <T> Collector<T, ?, Optional<Double>> regrAvgXDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY) {
        return collectingAndThen(
            collectors(summingDouble(functionY), count()),
            t -> t.v2 == 0 ? Optional.empty() : Optional.of(t.v1 / t.v2)
        );
    }
Get a {@link Collector} that calculates the <code>REGR_AVGX()</code> function.
jOOL/src/main/java/org/jooq/lambda/Agg.java