default <U> U reduceResultSet(U seed, ResultSetAccumulator<U> accumulator) {
        return scanResultSet((resultSetSupplier, context) -> {
            try (StatementContext ctx = context) {
                ResultSet resultSet = resultSetSupplier.get();

                U result = seed;
                while (resultSet.next()) {
                    result = accumulator.apply(result, resultSet, ctx);
                }
                return result;
            } catch (SQLException e) {
                throw new UnableToProduceResultException(e, context);
            }
        });
    }
Reduce the results.  Using a {@code ResultSetAccumulator}, repeatedly
combine query results until only a single value remains.

@param <U>         the accumulator type
@param seed        the {@code U} to combine with the first result
@param accumulator the function to apply repeatedly
@return the final {@code U}
core/src/main/java/org/jdbi/v3/core/result/ResultBearing.java