code: private static String generateRandomAutomaton(Random random) throws IOException {
  
          final Automaton<?, Integer, ?> automaton;
  
          if (random.nextBoolean()) {
              automaton = RandomAutomata.randomDFA(random, AUTOMATON_SIZE, INPUT_ALPHABET);
          } else {
              automaton = RandomAutomata.randomMealy(random, AUTOMATON_SIZE, INPUT_ALPHABET, OUTPUT_ALPHABET);
          }
  
          final StringWriter writer = new StringWriter();
  
          GraphDOT.write(automaton, INPUT_ALPHABET, writer);
  
          return writer.toString();
      }
docs: Generate DOT code for some random automaton.
  
  @param random
  the random object used for generating random values
  
  @return the serialized (DOT) representation of the automaton.