code: public static long mixTimeSpanAndPointInTime(long loadTime, long refreshAfter, long pointInTime) {
      long _refreshTime = loadTime + refreshAfter;
      if (_refreshTime < 0) {
        _refreshTime = ETERNAL;
      }
      if (pointInTime == ETERNAL) {
        return _refreshTime;
      }
      if (pointInTime > _refreshTime) {
        return _refreshTime;
      }
      long _absPointInTime = Math.abs(pointInTime);
      if (_absPointInTime <= _refreshTime) {
        return pointInTime;
      }
      long _pointInTimeMinusDelta = _absPointInTime - refreshAfter;
      if (_pointInTimeMinusDelta < _refreshTime) {
        return _pointInTimeMinusDelta;
      }
      return _refreshTime;
    }
docs: Combine a refresh time span and an expiry at a specified point in time.
  
  <p>If the expiry time is far ahead of time the refresh time span takes
  precedence. If the point in time is close by this time takes precedence.
  If the refresh time is too close to the requested point an earlier refresh
  time is used to keep maximum distance to the requested point time, which is
  {@code abs(pointInTime) - refreshAfter}
  
  <p>Rationale: Usually the expiry is allowed to lag behind. This is okay
  when a normal expiry interval is used. If sharp expiry is requested an
  old value may not be visible at or after the expiry time. Refresh ahead
  implies lagging expiry, since the refresh is triggered when the value would
  usually expire. The two concepts can be combined in the expiry policy, e.g.
  using an interval for triggering refresh ahead and requesting a sharp expiry
  only when needed. If effective expiry time for the lagging variant and the
  for the sharp variant are in close proximity, conflicts need to be resolved.
  
  @param loadTime time when the load was started
  @param refreshAfter time span in milliseconds when the next refresh should happen
  @param pointInTime time in milliseconds since epoch for the next expiry. Can be negative
  if sharp expiry is requested, or {@link #ETERNAL} if no point in time
  expiry is needed.