code: public boolean add(T e) {
          EdgeSet<T> from = addIfAbsent(e.from());
          EdgeSet<T> to = addIfAbsent(e.to());
  
          // Add this edge for the vertex to which the edge is pointing.  This
          // double-add behavior is necessary to ensure that the EdgeSet for each
          // vertices contains all the edges that connect to that vertex.
          //
          // NOTE: having the double add outside of the isNew check is also
          // necessary to support changing the weights on a WeightedGraph, where
          // adding a duplicate edge with a different weight will change the
          // weight but not add a new edge (i.e., increase the size).
          boolean isNew = from.add(e);
          to.add(e);
          if (isNew) 
              numEdges++;
          
          assert from.contains(e) : "error in EdgeSet contains logic";
          assert to.contains(e) : "error in EdgeSet contains logic";
  
          return isNew;
      }
docs: {@inheritDoc}