private List<ExplorerNode> getDescendants(final DocRef folderDocRef,
                                              final Function<ExplorerTreeNode, List<ExplorerTreeNode>> fetchFunction) {
        if (folderDocRef == null) {
            return explorerTreeDao.getRoots().stream()
                    .map(fetchFunction)
                    .flatMap(List::stream) // potential multiple roots returned from tree DAO
                    .map(this::createExplorerNode)
                    .collect(Collectors.toList());
        } else {
            return getNodeForDocRef(folderDocRef)
                    .map(fetchFunction)
                    .map(d -> d.stream()
                            .map(this::createExplorerNode)
                            .collect(Collectors.toList()))
                    .orElse(Collections.emptyList());
        }
    }
General form a function that returns a list of explorer nodes from the tree DAO

@param folderDocRef  The root doc ref of the query
@param fetchFunction The function to call to get the list of ExplorerTreeNodes given a root ExplorerTreeNode
@return The list of converted ExplorerNodes
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerNodeServiceImpl.java