code: private static <T> void addDependencies(final Vertex<T> vertex, final List<Vertex<T>> vertices)
      {
          if (!vertices.contains(vertex))
          {
              vertices.add(vertex);
  
              for (Vertex<T> v : vertex.getDependencies())
              {
                  addDependencies(v, vertices);
              }
          }
      }
docs: Recursively add a vertex and all of its dependencies to a list of
  vertices
  
  @param vertex Vertex to be added.
  @param vertices Existing list of vertices.