code: public int getTotalWeight() {
      int totalWeight = 0;
  
      // save out a copy of the values as HashMap.values() takes o(n) to return the value.
      final Collection<FactorComparator<T>> allValues = this.factorComparatorList.values();
      for (final FactorComparator<T> item : allValues) {
        if (item != null) {
          totalWeight += item.getWeight();
        }
      }
  
      return totalWeight;
    }
docs: function returns the total weight of the registered comparators.
  
  @return the value of total weight.