List<Statement> cases = Lists.create();
for (Tuple2<Enum<?>, FlowElementPortDescription> tuple : constants) {
Enum<?> constant = tuple.first;
FlowElementPortDescription port = tuple.second;
ResultMirror next = context.getOutput(port);
cases.add(f.newSwitchCaseLabel(f.newSimpleName(constant.name())));
cases.add(next.createAdd(context.getProcessInput(tx)));
cases.add(f.newBreakStatement());
}
cases.add(f.newSwitchDefaultLabel());
cases.add(new TypeBuilder(f, context.convert(AssertionError.class))