code: private static long toSafeNanos(long time, TimeUnit unit) {
      long timeoutNanos = unit.toNanos(time);
      return (timeoutNanos <= 0L)
          ? 0L
          : (timeoutNanos > (Long.MAX_VALUE / 4) * 3) ? (Long.MAX_VALUE / 4) * 3 : timeoutNanos;
    }
docs: Returns unit.toNanos(time), additionally ensuring the returned value is not at risk of
  overflowing or underflowing, by bounding the value between 0 and (Long.MAX_VALUE / 4) * 3.
  Actually waiting for more than 219 years is not supported!