public void sort(final ToIntFunction<ExplorerNode> priorityExtractor) {
        final Map<K, Set<ExplorerNode>> newChildMap = new HashMap<>();
        parentKeyToChildNodesMap.forEach((key, children) -> newChildMap.put(key, children
                .stream()
                .sorted(Comparator
                        .comparingInt(priorityExtractor)
                        .thenComparing(ExplorerNode::getType)
                        .thenComparing(ExplorerNode::getName))
                .collect(Collectors.toCollection(LinkedHashSet::new))));

        parentKeyToChildNodesMap = newChildMap;
    }
@return The sub-set of childNodes that have node info or one of their descendants has it.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/AbstractTreeModel.java