@Test
    void testStatementStreamCleanupBySetting() {
        h2Extension.getJdbi().getConfig(SqlStatements.class).setAttachAllStatementsForCleanup(true);

        try (Handle h = h2Extension.openHandle()) {
            Optional<String> userName = h.createQuery("SELECT name from users")
                    .mapTo(String.class)
                    .stream().findFirst();
            assertThat(userName).isPresent();
        }
    }
Many tests that try to provoke leaks and see whether the various checkers find them and various cleanup strategies catch them.
core/src/test/java/org/jdbi/v3/core/statement/LeakTest.java