@Test
    public void testLeakStreamDoNothing() {
        for (int i = 0; i < 1000; i++) {
            Stream<User> stream = dao.getStreamingUsers();
            assertThat(stream.findFirst()).containsInstanceOf(User.class);
        }
    }
An extension object that is attached to a handle can return iterators or streams. This class tests various ways on how this may leak resources.
sqlobject/src/test/java/org/jdbi/v3/sqlobject/AttachedHandleLeakTest.java