code: public Moment random() {
  
          MomentInterval interval = this.toCanonical();
  
          if (interval.isFinite() && !interval.isEmpty()) {
              Moment m1 = interval.getStartAsMoment();
              Moment m2 = interval.getEndAsMoment();
              double factor = MRD;
              double d1 = m1.getPosixTime() + m1.getNanosecond() / factor;
              double d2 = m2.getPosixTime() + m2.getNanosecond() / factor;
              double randomNum = ThreadLocalRandom.current().nextDouble(d1, d2);
              long posix = (long) Math.floor(randomNum);
              int fraction = (int) (MRD * (randomNum - posix));
              Moment random = Moment.of(posix, fraction, TimeScale.POSIX);
              if (random.isBefore(m1)) {
                  random = m1;
              } else if (random.isAfterOrEqual(m2)) {
                  random = m2.minus(1, TimeUnit.NANOSECONDS);
              }
              return random;
          } else {
              throw new IllegalStateException("Cannot get random moment in an empty or infinite interval: " + this);
          }
  
      }
docs: /*[deutsch]
  Liefert einen Zufallsmoment innerhalb dieses Intervalls. </p>
  
  @return  random moment within this interval
  @throws  IllegalStateException if this interval is infinite or empty or if there is no canonical form
  @see     #toCanonical()
  @since   5.0