AutomatonSpecification automaton1 = new NaiveAutomatonSpecification();
State q0 = automaton1.addState();
State q1 = automaton1.addState();
automaton1.addTransition(q0, q1, new CharTransitionLabel('a'));
automaton1.addLoop(q0, new CharTransitionLabel('b'));
automaton1.addLoop(q1, new CharTransitionLabel('a'));
automaton1.addLoop(q1, new CharTransitionLabel('b'));
automaton1.markAsInitial(q0);
automaton1.markAsFinal(q1);
AutomatonSpecification automaton2 = new NaiveAutomatonSpecification();
State q2 = automaton2.addState();
State q3 = automaton2.addState();
automaton2.addTransition(q2, q3, new CharTransitionLabel('b'));
automaton2.addTransition(q3, q2, new CharTransitionLabel('b'));
automaton2.addLoop(q2, new CharTransitionLabel('a'));
automaton2.addLoop(q3, new CharTransitionLabel('a'));
automaton2.markAsInitial(q2);
automaton2.markAsFinal(q3);
AlternativeOperator oper = new AlternativeOperator();