Plugin create(Options.Plugin plugin) {
        try {
            return instantiate(plugin.pluginString(), plugin.pluginClass(), plugin.argument());
        } catch (IOException | URISyntaxException e) {
            throw new CucumberException(e);
        }
    }
@Test
    void plugin_does_not_buffer_its_output() {
        PrintStream previousSystemOut = System.out;
        OutputStream mockSystemOut = new ByteArrayOutputStream();

        try {
            System.setOut(new PrintStream(mockSystemOut));

            // Need to create a new plugin factory here since we need it to pick
            // up the new value of System.out
            fc = new PluginFactory();

            PluginOption option = parse("progress");
            ProgressFormatter plugin = (ProgressFormatter) fc.create(option);
            EventBus bus = new TimeServiceEventBus(new ClockStub(ZERO), UUID::randomUUID);
            plugin.setEventPublisher(bus);
            Result result = new Result(Status.PASSED, ZERO, null);
            TestStepFinished event = new TestStepFinished(bus.getInstant(), mock(TestCase.class),
                mock(PickleStepTestStep.class), result);
            bus.send(event);

            assertThat(mockSystemOut.toString(), is(not(equalTo(""))));
        } finally {
            System.setOut(previousSystemOut);
        }
    }