protected void stopExtension() throws Exception {
        if (this.jdbi == null || this.sharedHandle == null) {
            throw new IllegalStateException("Extension was already stopped!");
        }

        try {
            final DataSource ds = getDataSource();
            Handle handle = sharedHandle;

            initializerMaybe.ifPresent(i -> i.cleanup(ds, sharedHandle));

            handle.close();
        } finally {
            this.dataSourceInitialized = false;

            this.dataSource = null;
            this.sharedHandle = null;
            this.jdbi = null;

            this.initializerMaybe = Optional.empty();
            this.plugins.clear();
        }

        if (enableLeakchecker) {
            leakChecker.checkForLeaks();
        }
    }
Convenience method to attach an extension (such as a SqlObject) to the shared handle.
testing/src/main/java/org/jdbi/v3/testing/junit5/JdbiExtension.java