code: public boolean contains(Object o) {
          if (o instanceof Edge) {
              Edge e = (Edge)o;
              int toFind = 0;
              if (e.to() == rootVertex) 
                  toFind = e.from();
              else if (e.from() == rootVertex)
                  toFind = e.to();
              else return false;
  
              boolean b = edges.contains(toFind);
              return b;
          }
          return false;
      }
docs: {@inheritDoc}