Plugin create(Options.Plugin plugin) {
        try {
            return instantiate(plugin.pluginString(), plugin.pluginClass(), plugin.argument());
        } catch (IOException | URISyntaxException e) {
            throw new CucumberException(e);
        }
    }
@Test
    void cant_create_plugin_when_file_is_a_directory() {
        Path jsonReport = tmp.resolve("target/cucumber/reports/cucumber.json");
        PluginOption jsonOption = parse("json:" + jsonReport);
        plugin = fc.create(jsonOption);

        Path htmlReport = tmp.resolve("target/cucumber/reports");
        PluginOption htmlOption = parse("html:" + htmlReport);

        IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> fc.create(htmlOption));
        assertThat(exception.getMessage(), is(equalTo(
            "Couldn't create a file output stream for '" + htmlReport + "'.\n" +
                    "Make sure the the file isn't a directory.\n" +
                    "\n" +
                    "Note: This usually happens when plugins write to colliding paths.\n" +
                    "For example: 'json:target/cucumber/report.json, html:target/cucumber'\n" +
                    "You can fix this by making the paths do no collide.\n" +
                    "For example: 'json:target/cucumber/report.json, html:target/cucumber/report.html'\n" +
                    "The details are in the stack trace below:")));
    }