code: @NonNull
    public Caffeine<K, V> expireAfterWrite(@NonNegative long duration, @NonNull TimeUnit unit) {
      requireState(expireAfterWriteNanos == UNSET_INT,
          "expireAfterWrite was already set to %s ns", expireAfterWriteNanos);
      requireState(expiry == null, "expireAfterWrite may not be used with variable expiration");
      requireArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
      this.expireAfterWriteNanos = unit.toNanos(duration);
      return this;
    }
docs: Specifies that each entry should be automatically removed from the cache once a fixed duration
  has elapsed after the entry's creation, or the most recent replacement of its value.
  <p>
  Expired entries may be counted in {@link Cache#estimatedSize()}, but will never be visible to
  read or write operations. Expired entries are cleaned up as part of the routine maintenance
  described in the class javadoc.
  <p>
  If you can represent the duration as a {@link java.time.Duration} (which should be preferred
  when feasible), use {@link #expireAfterWrite(Duration)} instead.
  
  @param duration the length of time after an entry is created that it should be automatically
  removed
  @param unit the unit that {@code duration} is expressed in
  @return this {@code Caffeine} instance (for chaining)
  @throws IllegalArgumentException if {@code duration} is negative
  @throws IllegalStateException if the time to live or variable expiration was already set