code: public static ExpiryPolicy<Object, Object> timeToLiveExpiration(Duration timeToLive) {
      Objects.requireNonNull(timeToLive, "TTL duration cannot be null");
      if (timeToLive.isNegative()) {
        throw new IllegalArgumentException("TTL duration cannot be negative");
      }
      return new TimeToLiveExpiryPolicy(timeToLive);
    }
docs: Get a time-to-live (TTL) {@link ExpiryPolicy} instance for the given {@link Duration}.
  
  @param timeToLive the TTL duration
  @return a TTL expiry