public static PluginOption parse(String pluginSpecification) {
        Matcher pluginWithFile = PLUGIN_WITH_ARGUMENT_PATTERN.matcher(pluginSpecification);
        if (!pluginWithFile.matches()) {
            Class<? extends Plugin> pluginClass = parsePluginName(pluginSpecification, pluginSpecification);
            return new PluginOption(pluginSpecification, pluginClass, null);
        }

        Class<? extends Plugin> pluginClass = parsePluginName(pluginSpecification, pluginWithFile.group(1));
        return new PluginOption(pluginSpecification, pluginClass, pluginWithFile.group(2));
    }
@Test
    void throws_for_plugins_that_do_not_implement_plugin() {
        IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
            () -> PluginOption.parse(String.class.getName()));

        assertThat(exception.getMessage(), is("The plugin specification 'java.lang.String' has a problem:\n" +
                "\n" +
                "'java.lang.String' does not implement 'io.cucumber.plugin.Plugin'.\n" +
                "\n" +
                "Plugin specifications should have the format of PLUGIN[:[PATH|[URI [OPTIONS]]]\n" +
                "\n" +
                "Valid values for PLUGIN are: html, json, junit, message, pretty, progress, rerun, summary, teamcity, testng, timeline, unused, usage\n"
                +
                "\n" +
                "PLUGIN can also be a fully qualified class name, allowing registration of 3rd party plugins. The 3rd party plugin must implement io.cucumber.plugin.Plugin"));
    }