code: public static SpanId generateRandomId(Random random) {
      long id;
      do {
        id = random.nextLong();
      } while (id == INVALID_ID);
      return new SpanId(id);
    }
docs: Generates a new random {@code SpanId}.
  
  @param random The random number generator.
  @return a valid new {@code SpanId}.
  @since 0.5