gen.defineOperator("op", "i0 i1", "o1 o2");
gen.connect("in", "op.i0");
gen.connect("empty", "op.i1");
gen.connect("op.o1", "out");
gen.connect("op.o2", "stop");
FlowGraph component = gen.toGraph();
gen = new FlowGraphGenerator();
gen.defineInput("in");
gen.defineOutput("out");
gen.defineFlowPart("c", component);
gen.connect("in", "c.in");
gen.connect("c.out", "out");
FlowGraph graph = gen.toGraph();
FlowGraph copy = FlowGraphUtil.deepCopy(graph);
Set<FlowElement> allComponents = FlowGraphUtil.collectFlowParts(copy);
assertThat(allComponents.size(), is(1));
FlowElement compElem = allComponents.iterator().next();