private static List<Node> findRoots(final Map<String, Node> spansById) {
    return spansById.values().stream()
      .filter(node -> Objects.equals(node.spanData.getParentSpanId(), SpanId.getInvalid()))
      .collect(Collectors.toList());
  }
A Rudimentary tool for visualizing a hierarchy of spans. Given a collection of spans, indexes
them from parents to children and prints them out one per line, indented.
hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/StringTraceRenderer.java