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