private boolean hideAutopopupIfMeaningless() {
    if (lookup.isLookupDisposed() || !isAutopopupCompletion() || lookup.isSelectionTouched() || lookup.isCalculating()) {
      return false;
    }

    lookup.refreshUi(true, false);
    for (LookupElement item : lookup.getItems()) {
      if (!isAlreadyInTheEditor(item)) {
        return false;
      }

      if (item.isValid() && item.isWorthShowingInAutoPopup()) {
        return false;
      }
    }

    lookup.hideLookup(false);
    LOG.assertTrue(CompletionServiceImpl.getCompletionService().getCurrentCompletion() == null);
    CompletionServiceImpl.setCompletionPhase(new CompletionPhase.EmptyAutoPopup(myEditor, myRestartingPrefixConditions));
    return true;
  }
private boolean hideAutopopupIfMeaningless()