class QueryChildren extends Children.Array {

    private Query query;
    private Query[] topQuery;

    public QueryChildren(Query query) {
        this.query = query;
    }

    public QueryChildren(Query[] topQuery) {   //Only for root node
        if (topQuery.length > 0) {
            this.topQuery = topQuery;
        }
    }

    @Override
    protected Collection<Node> initCollection() {<FILL_FUNCTION_BODY>}

    private static class HelpNode extends AbstractNode {

        public HelpNode() {
            super(Children.LEAF);
            setIconBaseWithExtension("DesktopFilters/drop.png");
        }

        @Override
        public String getHtmlDisplayName() {
            return NbBundle.getMessage(QueryChildren.class, "HelpNode.name");
        }

        @Override
        public PasteType getDropType(Transferable t, int action, int index) {
            if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
                try {
                    final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                    return new PasteType() {

                        @Override
                        public Transferable paste() throws IOException {
                            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                            Query f = filterController.createQuery(fb);
                            filterController.add(f);
                            return null;
                        }
                    };
                } catch (Exception ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
            return null;
        }

        @Override
        public Action[] getActions(boolean context) {
            return new Action[0];
        }
    }
}

        Collection<Node> nodesChildren = new ArrayList<>();
        if (query == null && topQuery == null) {
            nodesChildren.add(new HelpNode());
        } else {
            Query[] children = topQuery != null ? topQuery : query.getChildren();
            boolean hasParameters = query != null && query.getPropertiesCount() > 0;
            int slots = topQuery != null ? topQuery.length : query.getChildrenSlotsCount();

            if (slots == Integer.MAX_VALUE) {
                slots = children != null ? children.length + 1 : 1;
            }

            if (hasParameters) {
                nodesChildren.add(new ParameterNode(query));
            }
            for (int i = 0; i < slots; i++) {
                if (children != null && i < children.length) {
                    nodesChildren.add(new QueryNode(children[i]));
                } else {
                    nodesChildren.add(new SlotNode(query));
                }
            }
        }
        return nodesChildren;
    
<no_super_class>