@Override
    public void setMonochrome(boolean monochrome) {
        formats = monochrome ? monochrome() : ansi();
    }
@Test
    void should_print_output_from_afterStep_hooks() {
        Feature feature = TestFeatureParser.parse("path/test.feature", "" +
                "Feature: feature name\n" +
                "  Scenario: scenario name\n" +
                "    Given first step\n" +
                "    When second step\n");

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Runtime.builder()
                .withFeatureSupplier(new StubFeatureSupplier(feature))
                .withAdditionalPlugins(new PrettyFormatter(out))
                .withRuntimeOptions(new RuntimeOptionsBuilder().setMonochrome().build())
                .withBackendSupplier(new StubBackendSupplier(
                    emptyList(),
                    emptyList(),
                    asList(
                        new StubStepDefinition("first step", "path/step_definitions.java:3"),
                        new StubStepDefinition("second step", "path/step_definitions.java:4")),
                    singletonList(
                        new StubHookDefinition(testCaseState -> testCaseState.log("printed from afterstep hook"))),
                    emptyList()))
                .build()
                .run();

        assertThat(out, bytes(equalToCompressingWhiteSpace("" +
                "Scenario: scenario name # path/test.feature:2\n" +
                "  Given first step      # path/step_definitions.java:3\n" +
                "\n" +
                "    printed from afterstep hook\n" +
                "\n" +
                "  When second step      # path/step_definitions.java:4\n" +
                "\n" +
                "    printed from afterstep hook" +
                "\n")));
    }