public synchronized void useBundles(List<FileReference> newFileReferences) {
        if (! readyForNewBundles)
            throw new IllegalStateException("Bundles must be committed or reverted before using new bundles.");

        obsoleteBundles = removeObsoleteReferences(newFileReferences);
        osgi.allowDuplicateBundles(obsoleteBundles.values());

        bundlesFromNewGeneration = installBundles(newFileReferences);
        BundleStarter.startBundles(activeBundles.values());

        if (obsoleteBundles.size() > 0 || newFileReferences.size() > 0) log.info(installedBundlesMessage());

        readyForNewBundles = false;
    }
@Test
    void generation_must_be_marked_complete_before_using_new_bundles() {
        bundleLoader.useBundles(List.of(BUNDLE_1_REF));
        assertThrows(IllegalStateException.class,
                     () -> bundleLoader.useBundles(List.of(BUNDLE_1_REF)));
    }