public static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter) {
        return new TimeLimiterMetrics(List.of(timeLimiter));
    }
@Test
    public void shouldRecordErrors() {
        TimeLimiter timeLimiter = TimeLimiter.of(TimeLimiterConfig.ofDefaults());
        metricRegistry.registerAll(TimeLimiterMetrics.ofTimeLimiter(timeLimiter));

        timeLimiter.onError(new RuntimeException());
        timeLimiter.onError(new RuntimeException());

        assertThat(metricRegistry).hasMetricsSize(3);
        assertThat(metricRegistry).counter(DEFAULT_PREFIX + SUCCESSFUL)
            .hasValue(0L);
        assertThat(metricRegistry).counter(DEFAULT_PREFIX + FAILED)
            .hasValue(2L);
        assertThat(metricRegistry).counter(DEFAULT_PREFIX + TIMEOUT)
            .hasValue(0L);
    }