code: public int inDegree(int vertex) {
          int degree = 0;
          Set<T> edges = getAdjacencyList(vertex);
          if (edges == null)
              return 0;
          for (T e : edges) {
              if (e.to() == vertex)
                  degree++;
          }
          return degree;
      }
docs: {@inheritDoc}