presto-main/src/main/java/io/prestosql/type/setdigest/SetDigest.java/SetDigest/addHash
class SetDigest:    private void addHash(long hash)
    {
        short value = minhash.get(hash);
        if (value < Short.MAX_VALUE) {
            minhash.put(hash, (short) (value + 1));
        }
        while (minhash.size() > maxHashes) {
            minhash.remove(minhash.lastLongKey());
        }
    }