class UnionOperator implements Operator {

        @Override
        public int getInputCount() {
            return Integer.MAX_VALUE;
        }

        @Override
        public String getName() {
            return NbBundle.getMessage(UNIONBuilder.class, "UNIONBuilder.name");
        }

        @Override
        public FilterProperty[] getProperties() {
            return null;
        }

        @Override
        public Graph filter(Subgraph[] graphs) {
            Subgraph subGraph = graphs[0];
            for (int i = 1; i < graphs.length; i++) {
                subGraph.union(graphs[i]);
            }

            return subGraph;
        }

        @Override
        public Graph filter(Graph graph, Filter[] filters) {<FILL_FUNCTION_BODY>}
    }

            List<NodeFilter> nodeFilters = new ArrayList<>();
            List<EdgeFilter> edgeFilters = new ArrayList<>();
            for (Filter f : filters) {
                if (f instanceof NodeFilter) {
                    nodeFilters.add((NodeFilter) f);
                } else if (f instanceof EdgeFilter) {
                    edgeFilters.add((EdgeFilter) f);
                }
            }
            if (nodeFilters.size() > 0) {
                for (Iterator<NodeFilter> itr = nodeFilters.iterator(); itr.hasNext(); ) {
                    NodeFilter nf = itr.next();
                    if (!nf.init(graph)) {
                        itr.remove();
                    }
                }
                List<Node> nodesToRemove = new ArrayList<>();
                for (Node n : graph.getNodes()) {
                    boolean remove = true;
                    for (NodeFilter nf : nodeFilters) {
                        if (nf.evaluate(graph, n)) {
                            remove = false;
                        }
                    }
                    if (remove) {
                        nodesToRemove.add(n);
                    }
                }

                for (Node n : nodesToRemove) {
                    graph.removeNode(n);
                }
                for (NodeFilter nf : nodeFilters) {
                    nf.finish();
                }
            }
            if (edgeFilters.size() > 0) {
                for (Iterator<EdgeFilter> itr = edgeFilters.iterator(); itr.hasNext(); ) {
                    EdgeFilter ef = itr.next();
                    if (!ef.init(graph)) {
                        itr.remove();
                    }
                }
                List<Edge> edgesToRemove = new ArrayList<>();
                for (Edge e : graph.getEdges()) {
                    boolean remove = true;
                    for (EdgeFilter ef : edgeFilters) {
                        if (ef.evaluate(graph, e)) {
                            remove = false;
                        }
                    }
                    if (remove) {
                        edgesToRemove.add(e);
                    }
                }

                for (Edge e : edgesToRemove) {
                    graph.removeEdge(e);
                }
                for (EdgeFilter ef : edgeFilters) {
                    ef.finish();
                }
            }
            return graph;
        
<no_super_class>