private void addToInvertIndex (String term, int docId) {
        if(!invertIndex.containsKey(term)) {
            Set<Integer> docs = new HashSet<>(docNumber);
            docs.add(docId);
            invertIndex.put(term, docs);
        } else {
           invertIndex.get(term).add(docId);
        }
    }