default <A, R> R collectRows(Collector<RowView, A, R> collector) {
        return scanResultSet((resultSetSupplier, context) -> {
            try (StatementContext ctx = context) {
                ResultSet resultSet = resultSetSupplier.get();
                RowView rowView = new RowViewImpl(resultSet, ctx);

                A accumulator = collector.supplier().get();

                BiConsumer<A, RowView> consumer = collector.accumulator();
                while (resultSet.next()) {
                    consumer.accept(accumulator, rowView);
                }

                return collector.finisher().apply(accumulator);
            } catch (SQLException e) {
                throw new UnableToProduceResultException(e, context);
            }
        });
    }
Collect the results using the given collector. Do not attempt to accumulate the
{@link RowView} objects into the result--they are only valid within the
{@link Collector#accumulator()} function. Instead, extract mapped types from the
RowView by calling {@code RowView.getRow()} or {@code RowView.getColumn()}.

@param collector the collector to collect the result rows.
@param <A> the mutable accumulator type used by the collector.
@param <R> the result type returned by the collector.
@return the result of the collection
core/src/main/java/org/jdbi/v3/core/result/ResultBearing.java