public boolean add(ControlFlow o) throws YouShallNotDoThisException {
// final Node is already set. ->ActivityPath is unmodifiable
if (finalNode != null) {
throw new YouShallNotDoThisException("Final Node was already selected previously"); //$NON-NLS-1$
}
// check for adjacency
if (!(o.getSource().equals(nodes.get(nodes.size()-1)))) {
throw new YouShallNotDoThisException("You tried to insert a control flow, that is not adjacent to the last control flow in this path. A path has to consist of an ordered set of adjacent control flows!");
}
// Path ends here
if (o.getTarget() instanceof FinalNode) {
finalNode = (FinalNode) o.getTarget();
}