code: public double sum() {
          double sum = 0;
          for (WeightedDirectedTypedEdge<T> e : inEdges.values())
              sum += e.weight();
          for (WeightedDirectedTypedEdge<T> e : outEdges.values())
              sum += e.weight();
          return sum;
      }
docs: Returns the sum of the weights of the edges contained in this set.