code: public T max() {
          if (sum == 0)
              return null;
          int maxCount = -1;
          int maxIndex = -1;
          for (TIntIntIterator it = indexToCount.iterator(); it.hasNext(); ) {
              it.advance();
              if (it.value() > maxCount) {
                  maxIndex = it.key();
                  maxCount = it.value();
              }
          }
          return objectIndices.lookup(maxIndex);
      }
docs: Returns the element that currently has the largest count.  If no objects
  have been counted, {@code null} is returned.  Ties in counts are
  arbitrarily broken.