AutomatonSpecification automatbudowany = new NaiveAutomatonSpecification();
if (numberOfOccurrences == 0) {
State state = automatbudowany.addState();
automatbudowany.markAsInitial(state);
automatbudowany.markAsFinal(state);
}
if (numberOfOccurrences > 0) {
automatbudowany = subautomaton.clone();
for (int i = 1; i < numberOfOccurrences; i++) {