int getIndex(State s) {
return Integer.parseInt(s.getName().substring(1)) - 1;
}
Transition newTransition(State from, State to) {
Transition t = new Transition();
t.setFromState(from);
t.setToState(to);
t.setName(from.getName()+"->"+to.getName());
from.addOutgoingTransitions(t);
to.addIncomingTransitions(t);
return t;
}