public @NotNull Collection<SpanData> getCollectedSpans() {
    Map<String, SpanData> processedSpans = new HashMap<>();
    for (Map.Entry<String, SpanData> entry : collectedSpans.entrySet()) {
      SpanData span = entry.getValue();
      if (isValid(span)) {
        processedSpans.put(entry.getKey(), span);
        String parentSpanId = span.getParentSpanId();
        addParent(processedSpans, collectedSpans, parentSpanId);
      }
    }
    return processedSpans.values();
  }
public @NotNull Collection<SpanData> getCollectedSpans()