RegexpOperatorTree tree = new RegexpOperatorTree(root, subtrees);
//Tworzymy automat dla tego drzewa.
AutomatonSpecification automaton =
RegexpUtilities.createAutomatonFromOperatorTree(tree);
NondeterministicAutomatonByThompsonApproach result =
new NondeterministicAutomatonByThompsonApproach(automaton);
//Testujemy.
assertTrue(result.accepts("a"));
assertTrue(result.accepts("aaaaaaa"));
assertTrue(result.accepts("b"));
assertTrue(result.accepts("bbbbb"));
assertTrue(result.accepts("ab"));
assertTrue(result.accepts("abaaaabbb"));
assertTrue(result.accepts(""));
assertTrue(result.accepts("ccc"));
assertTrue(result.accepts("de"));
assertTrue(result.accepts("deeeeeeee"));
assertTrue(result.accepts("d"));
assertFalse(result.accepts("abbbbc"));
assertFalse(result.accepts("dddd"));
assertFalse(result.accepts("eeeee"));
assertFalse(result.accepts("testujtest"));
}