void (@NotNull String nameToOrder, String anchorName, boolean above) { if (!canReorder(nameToOrder, anchorName, above)) return; int index = myFavoritesRootsOrder.indexOf(anchorName); int toRemove = myFavoritesRootsOrder.indexOf(nameToOrder); myFavoritesRootsOrder.add(above? index : index +1, nameToOrder); myFavoritesRootsOrder.remove(toRemove > index ? toRemove+1 : toRemove); rootsChanged(); }