code: public static <D> String toDot(Iterable<? extends TarjanNode<D>> nodes, String name, String header) {
          StringBuilder buf = new StringBuilder();
          buf.append(String.format("digraph %s {\n", name));
          buf.append(String.format("label = \"%s\";\n", header));
          //dump nodes
          for (TarjanNode<D> n : nodes) {
              buf.append(String.format("%s [label = \"%s\"];\n", n.hashCode(), n.toString()));
          }
          //dump arcs
          for (TarjanNode<D> from : nodes) {
              for (DependencyKind dk : from.getSupportedDependencyKinds()) {
                  for (TarjanNode<D> to : from.getDependenciesByKind(dk)) {
                      buf.append(String.format("%s -> %s [label = \" %s \" style = %s ];\n",
                              from.hashCode(), to.hashCode(), from.getDependencyName(to, dk), dk.getDotStyle()));
                  }
              }
          }
          buf.append("}\n");
          return buf.toString();
      }
docs: Debugging: dot representation of a set of connected nodes. The resulting
  dot representation will use {@code Node.toString} to display node labels
  and {@code Node.printDependency} to display edge labels. The resulting
  representation is also customizable with a graph name and a header.