ontology/solr-facet-tree/src/main/java/uk/co/flax/biosolr/builders/AbstractFacetTreeBuilder.java
/**
	 * Find all of the top-level nodes in a map of parent - child node IDs.
	 * @param nodeChildren a map of parent - child node IDs..
	 * @return a set containing the IDs for all of the top-level nodes found.
	 */
Find all of the top-level nodes in a map of parent - child node IDs.
@param nodeChildren a map of parent - child node IDs
@return a set containing the IDs for all of the top-level nodes found.
Find all of the top - level nodes in a map of parent - child node IDs . @param nodeChildren a map of parent - child node IDs @return a set containing the IDs for all of the top - level nodes found .
protected Set<String> findTopLevelNodes(Map<String, Set<String>> nodeChildren) {
		Set<String> childIds = nodeChildren.values().stream().flatMap(c -> c.stream()).collect(Collectors.toSet());
		return nodeChildren.keySet().stream().filter(id -> !childIds.contains(id)).collect(Collectors.toSet());
	}
protected Set < String > findTopLevelNodes ( Map < String , Set < String > > nodeChildren ) { Set < String > childIds = nodeChildren . values ( ) . stream ( ) . flatMap ( c -> c . stream ( ) ) . collect ( Collectors . toSet ( ) ) ; return nodeChildren . keySet ( ) . stream ( ) . filter ( id -> ! childIds . contains ( id ) ) . collect ( Collectors . toSet ( ) ) ; }
Find all of the top-level nodes in a map of parent - child node IDs.
Find all of the top - level nodes in a map of parent - child node IDs .
// Extract all the child IDs to a set // Loop through each ID in the map, and check if it is contained in the // children of any other node.