@Test
    public void testForEach() {
        final Handle h = h2Extension.getSharedHandle();
        final int nbRecs = 42;
        for (int id = 1; id <= nbRecs; id++) {
            h.execute("insert into something (id, name) values (?, ?)", id, null);
        }

        final ResultIterable<Integer> ri = h.createQuery("select id from something").mapTo(Integer.class);

        assertThatThrownBy(() -> ri.forEach(null)).isInstanceOf(NullPointerException.class)
                .hasMessage("Action required");

        final AtomicInteger sum = new AtomicInteger(0);
        final int count = ri.forEachWithCount(sum::addAndGet);
        assertThat(count).isEqualTo(nbRecs);
        assertThat(sum.intValue()).isEqualTo(903);
    }
Test bean with a single member {@code name} of type {@link CharSequence}.
core/src/test/java/org/jdbi/v3/core/statement/TestQueries.java