code: public static <T> DiGraphIterator<T> getInstance(T root, Function<? super T, ? extends Collection<T>> edges)
      {
          return new DiGraphIterator<>(root, (y)->edges.apply(y).stream());
      }
docs: Creates a DiGraphIterator. It will iterate once for every node.
  @param root
  @param edges