SearchListModel (Computable<String> tabIDProvider) { MixedSearchListModel mixedModel = new MixedSearchListModel(); mixedModel.setTabIDProvider(tabIDProvider); Map<String, Integer> priorities = getContributorsPriorities(); Comparator<SearchEverywhereFoundElementInfo> prioritizedContributorsComparator = (element1, element2) -> { int firstElementPriority = priorities.getOrDefault(element1.getContributor().getSearchProviderId(), 0); int secondElementPriority = priorities.getOrDefault(element2.getContributor().getSearchProviderId(), 0); return Integer.compare(firstElementPriority, secondElementPriority); }; Comparator<SearchEverywhereFoundElementInfo> comparator = prioritizedContributorsComparator .thenComparing(SearchEverywhereFoundElementInfo.COMPARATOR) .reversed(); mixedModel.setElementsComparator(comparator); return mixedModel; }