@Override
    protected Optional<Retry> createProcessor(String businessName, RetryRule rule) {
        final io.sermant.flowcontrol.common.handler.retry.Retry retry = RetryContext.INSTANCE.getRetry();
        if (retry == null) {
            return Optional.empty();
        }
        final RetryConfig retryConfig = RetryConfig.custom()
                .maxAttempts(getMaxAttempts(retry, rule))
                .retryOnResult(retryPredicateCreator.createResultPredicate(retry, rule))
                .retryOnException(retryPredicateCreator.createExceptionPredicate(retry.retryExceptions()))
                .intervalFunction(getIntervalFunction(rule))
                .failAfterMaxAttempts(rule.isFailAfterMaxAttempts())
                .build();
        return Optional.of(RetryRegistry.of(retryConfig).retry(businessName));
    }
@Test
    public void test() {
        final RetryHandlerV2 retryHandlerV2 = new RetryHandlerV2();
        final AlibabaDubboRetry alibabaDubboRetry = new AlibabaDubboRetry();
        RetryContext.INSTANCE.markRetry(alibabaDubboRetry);
        final Retry test = retryHandlerV2.createProcessor("test", new RetryRule()).get();
        Assert.assertNotNull(test);
        RetryContext.INSTANCE.remove();
    }