public int count(Pair<T> obj) {
        long index = getIndex(obj);
        int count = counts.get(index);
        count++;
        counts.put(index, count);
        sum++;
        return count;
    }
public int count ( Pair < T > obj ) { long index = getIndex ( obj ) ; int count = counts . get ( index ) ; count ++ ; counts . put ( index , count ) ; sum ++ ; return count ; }
Counts the pair of objects, increasing its total count by 1.