private void addToRows(final List<ExplorerNode> in,
                           final List<ExplorerNode> rows,
                           final Set<ExplorerNodeKey> openItems) {
        for (ExplorerNode parent : in) {
            if (openItems.contains(parent.getUniqueKey())) {
                final ExplorerNode.Builder builder = parent.copy();
                if (!parent.hasNodeFlag(NodeFlag.LEAF)) {
                    builder.setGroupedNodeFlag(NodeFlagGroups.EXPANDER_GROUP, NodeFlag.OPEN);
                }
                rows.add(builder.build());

                final List<ExplorerNode> children = parent.getChildren();
                if (children != null) {
                    addToRows(children, rows, openItems);
                }

            } else {
                final ExplorerNode.Builder builder = parent.copy();
                if (!parent.hasNodeFlag(NodeFlag.LEAF)) {
                    builder.setGroupedNodeFlag(NodeFlagGroups.EXPANDER_GROUP, NodeFlag.CLOSED);
                }
                rows.add(builder.build());
            }
        }
    }
For use when setting an initial value for the filter.
stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTreeModel.java