@Override
    public void startInfrastructure(boolean shouldPoll) {
        removeBundleDirectory();
        goPluginOSGiFramework.start();

        addPluginChangeListener(new PluginChangeListener() {
            @Override
            public void pluginLoaded(GoPluginDescriptor pluginDescriptor) {

            }

            @Override
            public void pluginUnLoaded(GoPluginDescriptor pluginDescriptor) {
                synchronized (initializedPluginsWithTheirExtensionTypes) {
                    initializedPluginsWithTheirExtensionTypes.remove(pluginDescriptor);
                }
            }
        });

        monitor.addPluginJarChangeListener(defaultPluginJarChangeListener);
        if (shouldPoll) {
            monitor.start();
        } else {
            monitor.oneShot();
        }
    }
@Test
    void shouldStartOSGiFrameworkBeforeStartingMonitor() {
        new DefaultPluginManager(monitor, registry, goPluginOSGiFramework, jarChangeListener, null, systemEnvironment, pluginLoader).startInfrastructure(true);
        InOrder inOrder = inOrder(goPluginOSGiFramework, monitor);

        inOrder.verify(goPluginOSGiFramework).start();
        inOrder.verify(monitor).start();
    }