code: public RetryState createRetryState(RetryPolicy policy, MetricRecorder metricRecorder) {
          if (policy == null) {
              return new RetryStateNullImpl();
          } else {
              return new RetryStateImpl(policy, metricRecorder);
          }
      }
docs: Create an object implementing Retry
  
  @param policy the RetryPolicy, may be {@code null}
  @return a new RetryState