@Override
 public void moveUp(@NotNull String url) {
   int index = indexOf(url);
   if (index <= 0) return;
   dropCaches();
   ContainerUtil.swapElements(myList, index - 1, index);
 }
 @Override
 public void moveDown(@NotNull String url) {
   int index = indexOf(url);
   if (index < 0 || index + 1 >= myList.size()) return;
   dropCaches();
   ContainerUtil.swapElements(myList, index, index + 1);
 }
  private List<LookupElement> fillModelByRelevance(
      LookupImpl lookup,
      List<LookupElement> items,
      MultiMap<CompletionSorterImpl, LookupElement> inputBySorter,
      @Nullable LookupElement relevantSelection) {
    Iterator<LookupElement> byRelevance = sortByRelevance(inputBySorter).iterator();

    final LinkedHashSet<LookupElement> model = new LinkedHashSet<LookupElement>();

    addPrefixItems(model);
    addFrozenItems(items, model);
    addSomeItems(
        model,
        byRelevance,
        new Condition<LookupElement>() {
          @Override
          public boolean value(LookupElement lastAdded) {
            return model.size() >= MAX_PREFERRED_COUNT;
          }
        });
    addCurrentlySelectedItemToTop(lookup, items, model);

    freezeTopItems(lookup, model);

    ensureItemAdded(items, model, byRelevance, lookup.getCurrentItem());
    ensureItemAdded(items, model, byRelevance, relevantSelection);
    ensureEverythingVisibleAdded(lookup, model, byRelevance);

    ArrayList<LookupElement> result = new ArrayList<LookupElement>(model);
    if (result.size() > 1) {
      LookupElement first = result.get(0);
      if (isLiveTemplate(first) && isPrefixItem(lookup, first, true)) {
        ContainerUtil.swapElements(result, 0, 1);
      }
    }

    return result;
  }