code: @FFDCIgnore(ArithmeticException.class)
      public static long asClampedNanos(Duration duration) {
          try {
              return duration.toNanos();
          } catch (ArithmeticException e) {
              // Treat long overflow as an exceptional case
              if (duration.isNegative()) {
                  return Long.MIN_VALUE;
              } else {
                  return Long.MAX_VALUE;
              }
          }
      }
docs: Convert a duration to nanoseconds, clamping between MIN_VALUE and MAX_LONG
  <p>
  Needed in case a user specifies something silly like delay = 5 MILLENNIA
  <p>
  protected only to allow unit testing
  
  @param duration the duration to convert
  @return duration as nanoseconds, clamped if required