code: public static List<INodeEntry> rankOrderedNodes(Collection<INodeEntry> nodes, String rankProperty,
              boolean rankAscending) {
          final ArrayList<INodeEntry> nodes1 = new ArrayList<>(nodes);
          //reorder based on configured rank property and order
          final INodeEntryComparator comparator = new INodeEntryComparator(rankProperty);
  
          Collections.sort(nodes1, rankAscending ? comparator : Collections.reverseOrder(comparator));
          return nodes1;
      }
docs: Utility method to return nodes ordered by rank property
  
  @param nodes node collection
  @param rankProperty rank property
  @param rankAscending true if ascending
  
  @return ordered node list