public static @NotNull <T> String graphToString(@NotNull InboundSemiGraph<T> graph) {
    StringBuilder buffer = new StringBuilder();
    printNodes(graph.getNodes().iterator(), node -> graph.getIn(node), 0, new HashSet<>(), buffer);
    return buffer.toString();
  }
public static @NotNull <T> String graphToString(@NotNull InboundSemiGraph<T> graph)