code: public SparseUndirectedEdgeSet copy(IntSet vertices) {        
          SparseUndirectedEdgeSet copy = new SparseUndirectedEdgeSet(rootVertex);
          if (edges.size() < vertices.size()) {
              TIntIterator iter = edges.iterator();
              while (iter.hasNext()) {
                  int v = iter.next();
                  if (vertices.contains(v))
                      copy.edges.add(v);
              }            
          }
          else {
              IntIterator iter = vertices.iterator();
              while (iter.hasNext()) {
                  int v = iter.nextInt();
                  if (edges.contains(v)) 
                      copy.edges.add(v);
              }
          }
          return copy;
      }
docs: {@inheritDoc}