code: public static <T> void sortByPriority(List<T> someClasses, ToIntFunction<T> priorityExtractor) {
          someClasses.sort(Collections.reverseOrder(Comparator.comparingInt(priorityExtractor)));
      }
docs: Sort classes by <strong>descending</strong> order of their priority, meaning the class with
  the higher priority will
  be the first element of the sorted list. The priority is determined according to the
  provided priority extractor.
  
  @param someClasses       the list of classes to sort.
  @param priorityExtractor a function that extract a priority from an item.