code: @SuppressWarnings("unchecked")
    protected static <TGraph extends DirectedAcyclicGraph<TVertex, TValue, TProcessedValue>, TVertex extends IVertex<TValue>, TValue extends Object, TProcessedValue extends Object> TGraph copyGraph(final TGraph graph) {
      try {
        final Class g_class = graph.getClass();
        final Constructor<? extends DirectedAcyclicGraph<TVertex, TValue, TProcessedValue>> construct = g_class.getDeclaredConstructor();
        construct.setAccessible(true);
  
        final TGraph g = (TGraph)construct.newInstance();
  
        g.vertices = new LinkedHashSet<TVertex>(graph.vertices);
        g.edges = new LinkedHashSet<IEdge<TVertex>>(graph.edges);
        return g;
      } catch(Throwable t) {
        return null;
      }
    }
docs: Copies the {@link DirectedAcyclicGraph} portion of a class that extends {@link DirectedAcyclicGraph}. Anything else that
  is specific to a superclass should be added to the returned instance.
  
  @param graph An instance of {@link DirectedAcyclicGraph} that needs copying.
  @param <TVertex> Type of {@link IVertex} of the graph vertices.
  @param <TGraph> Type of {@link DirectedAcyclicGraph} of the graph being copied.
  @return A new instance of type {@link TGraph} with {@link DirectedAcyclicGraph} specific fields already filled in.