code: public void generateGraphVizDotFile(final File file) throws IOException {
          try (PrintWriter writer = new PrintWriter(file)) {
              writer.print(generateGraphVizDotFile());
          }
      }
docs: Generate a and save a .dot file, which can be fed into GraphViz for layout and visualization of the class
  graph.
  
  <p>
  Methods, fields and annotations are shown if enabled, via {@link ClassGraph#enableMethodInfo()},
  {@link ClassGraph#enableFieldInfo()} and {@link ClassGraph#enableAnnotationInfo()}.
  
  <p>
  Only public classes, methods, and fields are shown, unless {@link ClassGraph#ignoreClassVisibility()},
  {@link ClassGraph#ignoreMethodVisibility()}, and/or {@link ClassGraph#ignoreFieldVisibility()} has/have been
  called.
  
  @param file
  the file to save the GraphViz .dot file to.
  @throws IOException
  if the file could not be saved.
  @throws IllegalArgumentException
  if this {@link ClassInfoList} is empty or {@link ClassGraph#enableClassInfo()} was not called
  before scanning (since there would be nothing to graph).