code: public static long random(TemporalField field) {
      long max = Math.min(field.range().getMaximum(), Long.MAX_VALUE - 1);
      return randomLong(field.range().getMinimum(), max + 1);
    }
docs: Returns a random valid value for the given {@link TemporalField} between <code>
  TemporalField.range().min()</code> and <code>TemporalField.range().max()</code>. For example,
  <code>random({@link ChronoField#HOUR_OF_DAY})</code> will return a random value between 0-23.
  
  <p>Note: This will never return {@link Long#MAX_VALUE}. Even if it's a valid value for the
  given {@link TemporalField}.
  
  @param field the {@link TemporalField} to return a valid value for
  @return the random value