code: public boolean contains(Object o) {
          if (o instanceof DirectedEdge) {
              DirectedEdge e = (DirectedEdge)o;
              if (e.to() == rootVertex) 
                  return inEdges.contains(e.from());
              else if (e.from() == rootVertex)
                  return outEdges.contains(e.to());
          }
          return false;
      }
docs: {@inheritDoc}