code: public static void saveClass(Path rootDir, String packageName, String className, TypeSpec type)
        throws IOException {
  
      List<String> packagePath = Splitter.on('.').splitToList(packageName);
      Path classPath = Paths.get(rootDir.toString(), packagePath.toArray(EMPTY));
      Path outputFile = classPath.resolve(className + ".java");
  
      JavaFile javaFile = JavaFile.builder(packageName, type)
          .addFileComment("\n\nAUTO-GENERATED CLASS - DO NOT EDIT\n\n")
          // TODO: build timestamp and version info
          .build();
  
      System.out.println("saving " + outputFile);
      Files.createParentDirs(outputFile.toFile());
      CharSink sink = Files.asCharSink(outputFile.toFile(), Charsets.UTF_8);
      sink.write(javaFile.toString());
    }
docs: Saves a Java class file to a path for the given package, rooted in rootDir.