docs: void add(final Span span) {
      if (tags != null) {
        throw new AssertionError("The set of tags has already been computed"
                                 + ", you can't add more Spans to " + this);
      }
  
      // normalize timestamps to milliseconds for proper comparison
      final long start = (start_time & Const.SECOND_MASK) == 0 ? 
          start_time * 1000 : start_time;
      final long end = (end_time & Const.SECOND_MASK) == 0 ? 
          end_time * 1000 : end_time;
  
      if (span.size() == 0) {
        // copy annotations that are in the time range
        for (Annotation annot : span.getAnnotations()) {
          long annot_start = annot.getStartTime();
          if ((annot_start & Const.SECOND_MASK) == 0) {
            annot_start *= 1000;
          }
          long annot_end = annot.getStartTime();
          if ((annot_end & Const.SECOND_MASK) == 0) {
            annot_end *= 1000;
          }
          if (annot_end >= start && annot_start <= end) {
            annotations.add(annot);
          }
        }
      } else {
        long first_dp = span.timestamp(0);
        if ((first_dp & Const.SECOND_MASK) == 0) {
          first_dp *= 1000;
        }
        // The following call to timestamp() will throw an
        // IndexOutOfBoundsException if size == 0, which is OK since it would
        // be a programming error.
        long last_dp = span.timestamp(span.size() - 1);
        if ((last_dp & Const.SECOND_MASK) == 0) {
          last_dp *= 1000;
        }
        if (first_dp <= end && last_dp >= start) {
          this.spans.add(span);
          annotations.addAll(span.getAnnotations());
        }
      }
    }