private void addItemToLookup(CompletionResult item) {
    Ref<Boolean> stopRef = new Ref<>(Boolean.FALSE);
    DumbModeAccessType.RELIABLE_DATA_ONLY.ignoreDumbMode(() -> {
      stopRef.set(lookup.isLookupDisposed() || !lookup.addItem(item.getLookupElement(), item.getPrefixMatcher()));
    });

    if (stopRef.get()) {
      return;
    }

    myArranger.setLastLookupPrefix(lookup.getAdditionalPrefix());

    //noinspection NonAtomicOperationOnVolatileField
    count++; // invoked from a single thread

    if (count == myUnfreezeAfterNItems) {
      showLookupAsSoonAsPossible();
    }

    if (myLookupAppearancePolicy == LookupAppearancePolicy.ON_FIRST_POSSIBILITY && lookup.getShownTimestampMillis() == 0L) {
      AppExecutorUtil.getAppScheduledExecutorService().schedule(freezeSemaphore::up, 0, TimeUnit.MILLISECONDS);
      openLookupLater();
    }
    else {
      if (count == 1) {
        AppExecutorUtil.getAppScheduledExecutorService().schedule(freezeSemaphore::up, ourInsertSingleItemTimeSpan, TimeUnit.MILLISECONDS);
      }
      queue.queue(myUpdate);
    }
  }
private void addItemToLookup(CompletionResult item)