private synchronized int getId(String key) {
        int id = urlToId.get(key);
        if (id == urlToId.absentValue) {
            int maxId = urlToId.get("MAX");
            if (maxId == urlToId.absentValue) {
                id = 0;
            } else {
                id = maxId + 1;
            }
            urlToId.put("MAX", id);
            urlToId.put(key, id);
            idToUrl.put(id, key);
        }
        return id;
    }
Builds a "index" of near-duplicate pages using locality-sensitive hashing.

@author aeciosantos
ache/src/main/java/achecrawler/minhash/DuplicatePageIndexer.java