code: private void removeInternal(int vertex, EdgeSet<T> edges) {
          // Discount all the edges that were stored in this vertices edge set
          numEdges -= edges.size();
  
          // Now find all the edges stored in other vertices that might point to
          // this vertex and remove them
          for (Edge e : edges) {
              // Identify the other vertex in the removed edge and remove the
              // edge from the vertex's corresponding EdgeSet.
              int otherVertex = (e.from() == vertex) ? e.to() : e.from();
              EdgeSet<T> otherEdges = vertexToEdges.get(otherVertex);
              assert otherEdges.contains(e) 
                  : "Error in ensuring consistent from/to edge sets";
              otherEdges.remove(e);            
          }
  
          // Update any of the subgraphs that had this vertex to notify them
          // that it was removed
          Iterator<WeakReference<Subgraph>> iter = subgraphs.iterator();
          while (iter.hasNext()) {
              WeakReference<Subgraph> ref = iter.next();
              Subgraph s = ref.get();
              // Check whether this subgraph was already gc'd (the subgraph
              // was no longer in use) and if so, remove the ref from the list
              // to avoid iterating over it again
              if (s == null) {
                  iter.remove();
                  continue;
              }
  
              // Remove the vertex from the subgraph
              s.vertexSubset.remove(vertex);
          }
      }
docs: Removes the edges of the provided vertex from this graph, accounting for
  the presence of the edges in the corresponding {@link EdgeSet}'s for the
  other vertex in each edge.  This method should only be called once a
  vertex has been removed from the {@link #vertexToEdges} mapping.