Filter filter = filters[0];
if (filter instanceof NodeFilter && ((NodeFilter) filter).init(hgraph)) {
List<Node> nodeToRemove = new ArrayList<Node>();
NodeFilter nodeFilter = (NodeFilter) filter;
for (Node n : hgraph.getNodes().toArray()) {
if (nodeFilter.evaluate(hgraph, n)) {
nodeToRemove.add(n);
}
}
for (Node n : nodeToRemove) {
hgraph.removeNode(n);