public static void runJCToolsGenerator(Class<? extends JCToolsGenerator> generatorClass, String[] args) throws Exception {

        if (args.length < 2) {
            throw new IllegalArgumentException("Usage: outputDirectory inputSourceFiles");
        }

        File outputDirectory = new File(args[0]);

        for (int i = 1; i < args.length; i++) {
            File file = new File(args[i]);
            System.out.println("Processing " + file);
            CompilationUnit cu = new JavaParser().parse(file).getResult().get();
            JCToolsGenerator generator = buildGenerator(generatorClass, file.getName());
            generator.visit(cu, null);
            generator.organiseImports(cu);
            generator.cleanupComments(cu);

            String outputFileName = generator.translateQueueName(file.getName().replace(".java", "")) + ".java";

            try (FileWriter writer = new FileWriter(new File(outputDirectory, outputFileName))) {
                writer.write(cu.toString());
            }

            System.out.println("Saved to " + outputFileName);
        }
    }
Format a multiline javadoc comment with the given lines and indentation level.
jctools-build/src/main/java/org/jctools/queues/util/GeneratorUtils.java