public static <T> RetryTransformer<T> of(Retry retry) {
        return new RetryTransformer<>(retry);
    }
@Test
    public void returnOnErrorUsingCompletable() throws InterruptedException {
        RetryConfig config = retryConfig();
        Retry retry = Retry.of("testName", config);
        RetryTransformer<Object> retryTransformer = RetryTransformer.of(retry);
        doThrow(new HelloWorldException()).when(helloWorldService).sayHelloWorld();

        Completable.fromRunnable(helloWorldService::sayHelloWorld)
            .compose(retryTransformer)
            .test()
            .await()
            .assertError(HelloWorldException.class)
            .assertNotComplete();
        Completable.fromRunnable(helloWorldService::sayHelloWorld)
            .compose(retryTransformer)
            .test()
            .await()
            .assertError(HelloWorldException.class)
            .assertNotComplete();

        then(helloWorldService).should(times(6)).sayHelloWorld();
        Retry.Metrics metrics = retry.getMetrics();
        assertThat(metrics.getNumberOfFailedCallsWithRetryAttempt()).isEqualTo(2);
        assertThat(metrics.getNumberOfFailedCallsWithoutRetryAttempt()).isZero();
    }