code: public WeightedDirectedMultigraph<T> copy(Set<Integer> toCopy) {
          // special case for If the called is requesting a copy of the entire
          // graph, which is more easily handled with the copy constructor
          if (toCopy.size() == order() && toCopy.equals(vertices()))
              return new WeightedDirectedMultigraph<T>(this);
  
          WeightedDirectedMultigraph<T> g = new WeightedDirectedMultigraph<T>();
          for (int v : toCopy) {
              if (!vertexToEdges.containsKey(v))
                  throw new IllegalArgumentException(
                      "Request copy of non-present vertex: " + v);
              g.add(v);
              SparseWeightedDirectedTypedEdgeSet<T> edges = vertexToEdges.get(v);
              if (edges == null)
                  throw new IllegalArgumentException();
              for (int v2 : toCopy) {
                  if (v == v2)
                      break;
                  if (edges.connects(v2))
                      for (WeightedDirectedTypedEdge<T> e : edges.getEdges(v2))
                          g.add(e);
              }
          }
          return g;
      }
docs: {@inheritDoc}