private static List<Module> newModuleList(final Application app, final Class<? extends Application> appClass,
                                              Module... guiceModules) {
        List<Module> lst = new LinkedList<>();
        lst.addAll(List.of(guiceModules));
        lst.add(new AbstractModule() {

            @Override
            public void configure() {
                AnnotatedBindingBuilder<Application> builder = bind(Application.class);
                if (app != null) {
                    builder.toInstance(app);
                } else {
                    builder.to(appClass);
                }
            }
        });
        return lst;
    }
<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