code: public double count(T obj) {
          double count = counts.get(obj);
          count++;
          counts.put(obj, count);
          sum++;
          return count;
      }
docs: Counts the object, increasing its total count by 1.