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

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

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