private static TestDriver newInstance(OsgiFramework osgiFramework, String bundleLocation, boolean privileged,
                                          Iterable<? extends Module> guiceModules) {
        ApplicationLoader loader = new ApplicationLoader(osgiFramework, guiceModules);
        try {
            loader.init(bundleLocation, privileged);
        } catch (Exception e) {
            throw e instanceof RuntimeException ? (RuntimeException)e : new RuntimeException(e);
        }
        try {
            loader.start();
        } catch (Exception e) {
            loader.destroy();
            throw e instanceof RuntimeException ? (RuntimeException)e : new RuntimeException(e);
        }
        return new TestDriver(loader);
    }
<p>Factory method to create a light-weight {@link OsgiFramework} that throws {@link
UnsupportedOperationException} if {@link OsgiFramework#installBundle(String)} or {@link
OsgiFramework#startBundles(List, boolean)} is called. This allows for unit testing without the footprint of OSGi
support. This method is used by {@link TestDriver} factories that have the "WithoutOsgi" suffix.</p>

@return A non-working OsgiFramework.
jdisc_core/src/main/java/com/yahoo/jdisc/test/TestDriver.java