public static <T> RetryTransformer<T> of(Retry retry) {
        return new RetryTransformer<>(retry);
    }
@Test
    public void retryOnResultUsingSingle() throws InterruptedException {
        RetryConfig config = RetryConfig.<String>custom()
            .retryOnResult("retry"::equals)
            .waitDuration(Duration.ofMillis(50))
            .maxAttempts(3).build();
        Retry retry = Retry.of("testName", config);
        given(helloWorldService.returnHelloWorld())
            .willReturn("retry")
            .willReturn("success");

        Single.fromCallable(helloWorldService::returnHelloWorld)
            .compose(RetryTransformer.of(retry))
            .test()
            .await()
            .assertValueCount(1)
            .assertValue("success")
            .assertComplete();

        then(helloWorldService).should(times(2)).returnHelloWorld();
        Retry.Metrics metrics = retry.getMetrics();
        assertThat(metrics.getNumberOfFailedCallsWithoutRetryAttempt()).isZero();
        assertThat(metrics.getNumberOfSuccessfulCallsWithRetryAttempt()).isEqualTo(1);
    }