code: public int inDegree(int vertex) {
          SparseWeightedDirectedTypedEdgeSet<T> edges = vertexToEdges.get(vertex);
          return (edges == null) 
              ? 0
              : edges.predecessors().size();
      }
docs: {@inheritDoc}