void handleTestStepFinished(TestStepFinished event) {
        if (event.getTestStep() instanceof PickleStepTestStep && event.getResult().getStatus().is(Status.PASSED)) {
            PickleStepTestStep testStep = (PickleStepTestStep) event.getTestStep();
            addUsageEntry(event.getResult(), testStep);
        }
    }
@Test
    void resultWithPassedStep() {
        OutputStream out = new ByteArrayOutputStream();
        UsageFormatter usageFormatter = new UsageFormatter(out);
        TestStep testStep = mockTestStep();
        Result result = new Result(Status.PASSED, Duration.ofMillis(12345L), null);

        usageFormatter
                .handleTestStepFinished(new TestStepFinished(Instant.EPOCH, mock(TestCase.class), testStep, result));

        Map<String, List<UsageFormatter.StepContainer>> usageMap = usageFormatter.usageMap;
        assertThat(usageMap.size(), is(equalTo(1)));
        List<UsageFormatter.StepContainer> durationEntries = usageMap.get("stepDef");
        assertThat(durationEntries.size(), is(equalTo(1)));
        assertThat(durationEntries.get(0).getName(), is(equalTo("step")));
        assertThat(durationEntries.get(0).getDurations().size(), is(equalTo(1)));
        assertThat(durationEntries.get(0).getDurations().get(0).getDuration(), is(closeTo(12.345, EPSILON)));
    }