private void flushBatch() {
    synchronized (this) {
      for (Pair<LookupElement, LookupElementPresentation> pair: batchItems) {
        super.addElement(pair.first, pair.second);
      }
      batchItems.clear();
    }
    trimToLimit(createContext());
  }
private void flushBatch()