@Override
    public void contextCreated(StatementContext statementContext) {
        checkNotNull(statementContext, "statementContext is null!");

        assertThat(contextElements)
            .withFailMessage(() ->
                format("statement context %s has already been created by thread %s", statementContext, contextElements.get(statementContext)))
            .doesNotContainKey(statementContext);

        contextElements.putIfAbsent(statementContext, new RecordingContext<>());
    }
A simple leak checker that tracks statement context and cleanable resource management.
core/src/test/java/org/jdbi/v3/core/junit5/JdbiLeakChecker.java