automaton.markAsInitial(q0);
automaton.markAsFinal(q2);
OptionalityOperator operator = new OptionalityOperator();
NondeterministicAutomatonByThompsonApproach result =
new NondeterministicAutomatonByThompsonApproach(
operator.createAutomatonFromOneAutomaton(automaton));
assertTrue(result.accepts("aaabbb"));
assertTrue(result.accepts("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb"));
assertTrue(result.accepts("aabbbbbbbbbbbbb"));
assertTrue(result.accepts("ab"));
assertTrue(automaton.acceptEmptyWord());
assertFalse(result.accepts("aaabbbbaabbbbab"));
assertFalse(result.accepts("aaaaaaaaaaa"));
assertFalse(result.accepts("cojapacze"));
assertFalse(result.accepts("macrimnatueshzanc"));
assertFalse(result.accepts("katrayzniaedc"));
assertFalse(result.accepts("jestemglupimstringieminicnieznacze"));
assertFalse(result.accepts("jestemautomateminieakceptuje"));
}