code: public void add(E edge) {
          if (! edge.added) { 
              edges.add(edge);
              edge.added = true;
              add(edge.getChild());
              add(edge.getParent());
          }
      }
docs: Adds the edge and its nodes if not already present in the graph.