code: public static <T> @NonNull List<T> topologicalSort(final @NonNull Graph<T> graph) {
      return topologicalSort(graph, SortType.random());
    }
docs: Sorts a directed acyclic graph into a list.
  
  <p>The particular order of elements without prerequisites is not guaranteed.</p>
  
  @param graph the graph to be sorted
  @param <T> the node type
  @return the sorted list
  @throws CyclePresentException if the graph has cycles
  @throws IllegalArgumentException if the graph is not directed or allows self loops