code: public CompactSparseTypedEdgeSet<T> copy(IntSet vertices) {        
           CompactSparseTypedEdgeSet<T> copy = new CompactSparseTypedEdgeSet<T>(rootVertex);
           
           if (vertices.size() < edges.size()) {
              IntIterator iter = vertices.iterator();
              while (iter.hasNext()) {
                  int v = iter.nextInt();
                  if (edges.containsKey(v)) {
                      BitSet b = edges.get(v);
                      BitSet b2 = new BitSet();
                      b2.or(b);
                      copy.edges.put(v, b2);
                  }
              }            
          }
          else {
              TIntObjectIterator<BitSet> iter = edges.iterator();
              while (iter.hasNext()) {
                  iter.advance();
                  int v = iter.key();
                  if (vertices.contains(v)) {
                      BitSet b = iter.value();
                      BitSet b2 = new BitSet();
                      b2.or(b);
                      copy.edges.put(v, b2);
                  }
              }
          }
          return copy;
      }
docs: {@inheritDoc}