code: @SuppressWarnings("unchecked")
    public T withMaxDuration(Duration maxDuration) {
      Assert.notNull(maxDuration, "maxDuration");
      this.maxDuration = maxDuration;
      return (T) this;
    }
docs: Sets the max duration to perform attempts for.
  
  @throws NullPointerException if {@code maxDuration} is null