LookupElement @NotNull [] getResult() {
    final List<LookupElement> result = new ArrayList<>(myMap.size());
    for (final Entry<LookupElementBuilder, Pair<String, Integer>> entry : myMap.entrySet()) {
      LookupElementBuilder elementBuilder = entry.getKey();
      final Pair<String, Integer> helpAndPriority = entry.getValue();
      final String help = helpAndPriority.first;

      if (!StringUtil.isEmptyOrSpaces(help)) {
        final int padding = myMaxLength - elementBuilder.getLookupString().length();
        elementBuilder = elementBuilder.withTailText(String.format("%s : %s", StringUtil.repeat(" ", padding), help));
      }
      if (myHasPriority) {
        // If we have priority and it is not provided for certain element we believe it is 0
        final int priority = (helpAndPriority.second == null ? 0 : helpAndPriority.second);
        result.add(PrioritizedLookupElement.withPriority(elementBuilder, priority));
      }
      else {
        result.add(elementBuilder);
      }
    }
    return result.toArray(LookupElement.EMPTY_ARRAY);
  }
LookupElement @NotNull [] getResult()