gen.connect("in", "op1").connect("op1", "op2").connect("op2", "out");
FlowBlock block = FlowBlock.fromPorts(
0,
gen.toGraph(),
new ArrayList<FlowElementInput>(gen.inputs("op1")),
new ArrayList<FlowElementOutput>(gen.outputs("op2")),
gen.getAsSet("op1", "op2"));
block.detach();
assertThat(block.getElements().size(), is(2));