code: public void setRetention(long duration, TimeUnit timeUnit) {
          this._duration = Math.max(1, duration);
          this._timeUnit = timeUnit;
          
          long millis = TimeUnit.MILLISECONDS == timeUnit ?
                  _duration : TimeUnit.MILLISECONDS.convert(_duration, timeUnit);
          _timeMillis = Math.max(millis, MIN_DURATION_MILLIS);
      }
docs: Sets the retention duration period of this policy.
  
  @param duration - the retention duration
  @param timeUnit - the time unit as defined by {@link TimeUnit}