code: public boolean remove(Object o) {
          if (o instanceof WeightedEdge) {
              WeightedEdge e = (WeightedEdge)o;
              int toRemove = 0;
              if (e.to() == rootVertex) 
                  toRemove = e.from();
              else if (e.from() == rootVertex)
                  toRemove = e.to();
              else return false;
              if (edges.containsKey(toRemove)) {
                  edges.remove(toRemove);
                  return true;
              }
              return false;
          }
          return false;
      }
docs: {@inheritDoc}