@Override
    public boolean available(String pluginName) {
        if (StringUtils.isBlank(pluginName)) {
            return false;
        }
        PluginWrapper pluginWrapper = pluginManager.getPlugin(pluginName);
        if (pluginWrapper == null) {
            return false;
        }
        return PluginState.STARTED.equals(pluginWrapper.getPluginState());
    }
@Test
    void availableWithVersionTest() {
        when(haloPluginManager.getVersionManager()).thenReturn(new DefaultVersionManager());

        assertThatThrownBy(() -> pluginFinder.available("fake-plugin", null))
            .isInstanceOf(IllegalArgumentException.class);

        boolean available = pluginFinder.available("fake-plugin", "1.0.0");
        assertThat(available).isFalse();

        PluginWrapper mockPluginWrapper = Mockito.mock(PluginWrapper.class);
        when(haloPluginManager.getPlugin(eq("fake-plugin")))
            .thenReturn(mockPluginWrapper);

        when(mockPluginWrapper.getPluginState()).thenReturn(PluginState.STARTED);
        var descriptor = mock(PluginDescriptor.class);
        when(mockPluginWrapper.getDescriptor()).thenReturn(descriptor);
        when(descriptor.getVersion()).thenReturn("1.0.0");

        available = pluginFinder.available("fake-plugin", "1.0.0");
        assertThat(available).isTrue();

        available = pluginFinder.available("fake-plugin", ">=1.0.0");
        assertThat(available).isTrue();

        available = pluginFinder.available("fake-plugin", "<2.0.0");
        assertThat(available).isTrue();

        available = pluginFinder.available("fake-plugin", "2.0.0");
        assertThat(available).isFalse();

        available = pluginFinder.available("fake-plugin", "<1.0.0");
        assertThat(available).isFalse();
    }