code: public TimeoutState createTimeoutState(ScheduledExecutorService executorService, TimeoutPolicy policy, MetricRecorder metricRecorder) {
          if (policy == null) {
              return new TimeoutStateNullImpl();
          } else {
              return new TimeoutStateImpl(executorService, policy, metricRecorder);
          }
      }
docs: Create an object implementing Timeout
  
  @param executorService the executor to use to schedule the timeout callback
  @param policy          the TimeoutPolicy, may be {@code null}
  @return a new TimeoutState