Utility method to return nodes ordered by rank property

@param nodes node set
@param rankProperty rank property
@param rankAscending true if ascending

@return ordered node list
503108
public static List<INodeEntry> rankOrderedNodes(INodeSet nodes, String rankProperty,
            boolean rankAscending) {
        return rankOrderedNodes(nodes.getNodes(), rankProperty, rankAscending);
    }
55775
protected SortedMap<String, String> getProperties(ITextNode[]nodes, String language, Status[] status) {
    TreeMap<String, String> map = new TreeMap<>();
    for (ITextNode node : nodes) {
      IValueNode valueNode = node.getValueNode(language);
      if (valueNode != null) {
        if (status == null || TremaCoreUtil.containsStatus(valueNode.getStatus(), status)) {
          IKeyValuePair keyValuePair = new KeyValuePair(node.getKey(), valueNode.getValue());
          if (iExportFilters != null) {
            for (IExportFilter filter : iExportFilters) {
              filter.filter(keyValuePair);
            }
          }
          map.put(keyValuePair.getKey(), keyValuePair.getValue());
        }
      }
    }
    return map;
  }
1261967
public List<T> getRoots() {
    List<T> roots = new ArrayList<>();
    for (DirectedAcyclicGraphNode<T> root : mRoots) {
      roots.add(root.getPayload());
    }
    return roots;
  }
988413
public static <T> List<T> toposort(T root, Deps<T> deps) {
        List<T> order = new ArrayList<T>();
        HashSet<T> done = new HashSet<T>();
        Stack<T> todo = new Stack<T>();
        HashSet<T> ancestors = new HashSet<T>();
        
        // Run a Tarjan (1976) style topological sort.   
        todo.push(root);
        while (!todo.isEmpty()) {
            T x = todo.peek();
            // Whether all x's descendents are done.
            boolean ready = true;
            for (T y : deps.getDeps(x)) {
                if (!done.contains(y)) {
                    ready = false;
                    todo.push(y);
                }
            }
            if (ready) {
                todo.pop();
                ancestors.remove(x);
                if (done.add(x)) {
                    order.add(x);
                }
            } else {
                if (ancestors.contains(x)) {
                    throw new IllegalStateException("Graph is not a DAG. Cycle involves node: " + x);
                }
                ancestors.add(x);
            }
        }
        return order;
    }
503208
protected SortedProperties getProperties(ITextNode[]nodes, String language, Status[] status) {
    SortedProperties properties = new SortedProperties();
    for (ITextNode node : nodes) {
      IValueNode valueNode = node.getValueNode(language);
      if (valueNode != null) {
        if (status == null || TremaCoreUtil.containsStatus(valueNode.getStatus(), status)) {
          IKeyValuePair keyValuePair = new KeyValuePair(node.getKey(), valueNode.getValue());
          if (iExportFilters != null) {
            for (IExportFilter filter : iExportFilters) {
              filter.filter(keyValuePair);
            }
          }
          properties.setProperty(keyValuePair.getKey(), keyValuePair.getValue());
        }
      }
    }
    return properties;
  }
719681
public java.util.List<NodeGroupMember> getNodeGroupMembers() {
        if (nodeGroupMembers == null) {
            nodeGroupMembers = new com.amazonaws.internal.SdkInternalList<NodeGroupMember>();
        }
        return nodeGroupMembers;
    }
86083
public Table sortDescendingOn(String... columnNames) {
        Sort key = getSort(columnNames);
        return sortOn(key);
    }
761739
public static <T extends Node> List<T> findNodes(List<Node> nodes, Class<T> cls) {
        List<T> results = new ArrayList<>();
        findNodes(nodes, cls, results);
        return results;
    }
953460
public Set<InternalQName> getSupertypes(InternalQName name, Map<InternalQName, NodeTypeData> volatileNodeTypes)
      throws RepositoryException
   {

      return hierarchy.getSupertypes(name, volatileNodeTypes);
   }
1284229
public static Collection<? extends GraphEntity> getAscendantsOfRole(
            GraphEntity ge) {
        Vector<GraphEntity> allAscendants = new Vector<GraphEntity>();
        try {
            Vector<GraphEntity> ascendants = Utils.getRelatedElementsVector(ge,
                    "ARoleInheritance", "ARoleInheritancetarget");
            while (!ascendants.isEmpty()) {
                allAscendants.addAll(ascendants);
                ascendants.clear();
                for (GraphEntity ascendant : allAscendants) {

                    ascendants.addAll(Utils.getRelatedElementsVector(ascendant,
                            "ARoleInheritance", "ARoleInheritancetarget"));

                }
                ascendants.removeAll(allAscendants);
            }
        } catch (NullEntity e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return allAscendants;

    }
727872
public static Criteria criteriaFromNode(Node node, Comparator rangeComparator) {
        return criteriaFromNode(node, rangeComparator, null);
    }
932817
protected List<Element> filterDescendants(Element parent, String[] tagNames)
    {
        List<Element> result = new ArrayList<Element>();
        for (String tagName : tagNames) {
            NodeList nodes = parent.getElementsByTagName(tagName);
            for (int i = 0; i < nodes.getLength(); i++) {
                Element element = (Element) nodes.item(i);
                result.add(element);
            }
        }
        return result;
    }
901544
public void setNodeRangeProperties(java.util.Collection<NodeRangeProperty> nodeRangeProperties) {
        if (nodeRangeProperties == null) {
            this.nodeRangeProperties = null;
            return;
        }

        this.nodeRangeProperties = new java.util.ArrayList<NodeRangeProperty>(nodeRangeProperties);
    }
114743
public List<Node> siblingNodes() {
        if (parentNode == null)
            return Collections.emptyList();

        List<Node> nodes = parentNode.ensureChildNodes();
        List<Node> siblings = new ArrayList<>(nodes.size() - 1);
        for (Node node: nodes)
            if (node != this)
                siblings.add(node);
        return siblings;
    }
644019
public JsonComparator getComparator(List<String> context,
                                        JsonNode node1,
                                        JsonNode node2) {
        if (node1 == null) {
            if (node2 == null) {
                return NODIFF_CMP;
            } else {
                return null;
            }
        } else if (node2 == null) {
            return null;
        } else {
            if (node1 instanceof NullNode) {
                if (node2 instanceof NullNode) {
                    return NODIFF_CMP;
                } else {
                    return null;
                }
            } else if (node2 instanceof NullNode) {
                return null;
            }
            // Nodes are not null, and they are not null node
            if (node1.isContainerNode() && node2.isContainerNode()) {
                if (node1 instanceof ObjectNode) {
                    return objectComparator;
                } else if (node1 instanceof ArrayNode) {
                    return arrayComparator;
                }
            } else if (node1.isValueNode() && node2.isValueNode()) {
                return valueComparator;
            }
        }
        return null;
    }
718892
public Object postOrder(NodeVisitor nodeVisitor, Node root) {
        return postOrder(nodeVisitor, Collections.singleton(root));
    }
404654
public List<NodeValue<K, V>> getRepairs(List<NodeValue<K, V>> nodeValues) {
        int size = nodeValues.size();
        if(size <= 1)
            return Collections.emptyList();

        Map<K, List<NodeValue<K, V>>> keyToNodeValues = Maps.newHashMap();
        for(NodeValue<K, V> nodeValue: nodeValues) {
            List<NodeValue<K, V>> keyNodeValues = keyToNodeValues.get(nodeValue.getKey());
            if(keyNodeValues == null) {
                keyNodeValues = Lists.newArrayListWithCapacity(5);
                keyToNodeValues.put(nodeValue.getKey(), keyNodeValues);
            }
            keyNodeValues.add(nodeValue);
        }

        List<NodeValue<K, V>> result = Lists.newArrayList();
        for(List<NodeValue<K, V>> keyNodeValues: keyToNodeValues.values())
            result.addAll(singleKeyGetRepairs(keyNodeValues));
        return result;
    }