code: public void add(DOCUMENT doc) {
        if (doc != null) {
           documents.add(doc);
           int id = documents.size() - 1;
           for (KEY key : documentMapper.apply(doc)) {
              index.put(key, id);
           }
        }
     }
docs: Add void.
  
  @param doc the doc