/** * Filter the given nodes to only include nodes with the service on it, and sort all those nodes by node number. * * @param clusterNodes Set of all cluster nodes. * @return Sorted list of nodes with the service on it. */ protected List<Node> sortServiceNodes(Set<Node> clusterNodes) { List<Node> filteredNodes = nodesForService(clusterNodes); Collections.sort(filteredNodes, NODE_NUM_COMPARATOR); return filteredNodes; }