private boolean search ( LinkedList < Control > list , Interaction inter ) { if ( list . getLast ( ) . getControlled ( ) . contains ( inter ) ) return true ; for ( Process process : list . getLast ( ) . getControlled ( ) ) { if ( process instanceof Control ) { // prevent searching in cycles if ( list . contains ( process ) ) continue ; list . add ( ( Control ) process ) ; if ( search ( list , inter ) ) return true ; else list . removeLast ( ) ; } } return false ; }
Checks if the control chain is actually controlling the Interaction .