public Process<?, ?> sequence(List<Process<?, ?>> processes) { Process<?, ?> parent = this; if (processes != null) { for (Process<?, ?> p : processes) { parent.node.sucs.add(p.node); parent = p; p.result = result; } } return parent; }
public <S> Process<T, S> sequence(Process<T, S> process) { node.sucs.add(process.node); process.result = result; return process; }