@Override
    public void pluginStateChanged(PluginStateEvent event) {
        log.debug("The state of plugin '{}' has changed from '{}' to '{}'", event.getPlugin().getPluginId(),
            event.getOldState(), event.getPluginState());
    }
@Test
    void pluginStateChangedShouldLogStateChange() {
        Logger mockedLogger = mock(Logger.class);

        try (MockedStatic<LoggerFactory> context = Mockito.mockStatic(LoggerFactory.class)) {
            context.when(() -> LoggerFactory.getLogger(Mockito.any(Class.class)))
                .thenReturn(mockedLogger);

            // create a PluginStateEvent
            PluginManager pluginManager = mock(PluginManager.class);
            PluginWrapper pluginWrapper = mock(PluginWrapper.class);
            when(pluginWrapper.getPluginId()).thenReturn("testPlugin");
            when(pluginWrapper.getPluginState()).thenReturn(PluginState.STARTED);
            PluginStateEvent event = new PluginStateEvent(pluginManager, pluginWrapper, PluginState.CREATED);

            // call the method under test
            LoggingPluginStateListener listener = new LoggingPluginStateListener();
            listener.pluginStateChanged(event);

            // verify that the logger was called with the expected message
            verify(mockedLogger).debug("The state of plugin '{}' has changed from '{}' to '{}'", "testPlugin", PluginState.CREATED, PluginState.STARTED);
        }
    }