code: public static List<CompiledAutomaton> createAutomata(String prefix,
        String regexp, Map<String, Automaton> automatonMap) throws IOException {
      List<CompiledAutomaton> list = new ArrayList<>();
      Automaton automatonRegexp = null;
      if (regexp != null) {
        RegExp re = new RegExp(prefix + MtasToken.DELIMITER + regexp + "\u0000*");
        automatonRegexp = re.toAutomaton();
      }
      int step = 500;
      List<String> keyList = new ArrayList<>(automatonMap.keySet());
      for (int i = 0; i < keyList.size(); i += step) {
        int localStep = step;
        boolean success = false;
        CompiledAutomaton compiledAutomaton = null;
        while (!success) {
          success = true;
          int next = Math.min(keyList.size(), i + localStep);
          List<Automaton> listAutomaton = new ArrayList<>();
          for (int j = i; j < next; j++) {
            listAutomaton.add(automatonMap.get(keyList.get(j)));
          }
          Automaton automatonList = Operations.union(listAutomaton);
          Automaton automaton;
          if (automatonRegexp != null) {
            automaton = Operations.intersection(automatonList, automatonRegexp);
          } else {
            automaton = automatonList;
          }
          try {
            compiledAutomaton = new CompiledAutomaton(automaton);
          } catch (TooComplexToDeterminizeException e) {
            log.debug(e);
            success = false;
            if (localStep > 1) {
              localStep /= 2;
            } else {
              throw new IOException("TooComplexToDeterminizeException");
            }
          }
        }
        list.add(compiledAutomaton);
      }
      return list;
    }
docs: Creates the automata.
  
  @param prefix the prefix
  @param regexp the regexp
  @param automatonMap the automaton map
  @return the list
  @throws IOException Signals that an I/O exception has occurred.