public Transition getExistingOutgoingTransition(Transition t) {
        Transition existing = null;
        State toState = t.getToState();
        for(int i=0; i<outgoingTransitions.size() && existing == null; i++) {
            State from = outgoingTransitions.get(i).getFromState();
            State to = outgoingTransitions.get(i).getToState();
            if(from.equals(this) && to.equals(toState)) {
                existing = outgoingTransitions.get(i);
            }
        }
        return existing;
    }