public void addToDoubleWordIndex(String elem, int docId) {
        if(!doubleWordIndex.containsKey(elem)) {
            Set docs = new HashSet();
            docs.add(docId);
            doubleWordIndex.put(elem, docs);
        } else {
           doubleWordIndex.get(elem).add(docId);
        }
    }