public static <T> RetryOperator<T> of(Retry retry) {
        return new RetryOperator<>(retry);
    }
@Test
    public void retryOnResultFailAfterMaxAttemptsUsingFlux() {
        RetryConfig config = RetryConfig.<String>custom()
            .retryOnResult("retry"::equals)
            .waitDuration(Duration.ofMillis(10))
            .maxAttempts(3).build();
        Retry retry = Retry.of("testName", config);

        StepVerifier.create(Flux.just("retry")
            .transformDeferred(RetryOperator.of(retry)))
            .expectSubscription()
            .expectNextCount(1)
            .expectComplete()
            .verify(Duration.ofSeconds(1));

        Retry.Metrics metrics = retry.getMetrics();
        assertThat(metrics.getNumberOfFailedCallsWithoutRetryAttempt()).isZero();
        assertThat(metrics.getNumberOfFailedCallsWithRetryAttempt()).isEqualTo(1);
    }