@Test
    void testManagedTransactionExplodingStatementNeedsHandleCleanup() {
        assertThatExceptionOfType(UnableToExecuteStatementException.class).isThrownBy(() ->
                h2Extension.getJdbi().useTransaction(managedHandle -> {
                    managedHandle.createQuery("SELECT name from users")
                            .attachToHandleForCleanup()
                            .setFetchSize(-1)
                            .mapTo(String.class)
                            .list();
                }));
    }
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