public void render(final Consumer<String> writer) {
    for (ListIterator<Node> iter = graphs.listIterator(); iter.hasNext();) {
      final int idx = iter.nextIndex();
      final Node node = iter.next();
      render(writer, node, 0, idx == 0);
    }
  }
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