public static void addImports(ASTRewrite rewrite, CompilationUnit compilationUnit,
Comparator<? super ImportDeclaration> comparator, boolean staticImports, String... imports) {
checkForNull(comparator, "import comparator");
checkForNull(imports, "imports");
final AST ast = rewrite.getAST();
SortedSet<ImportDeclaration> importDeclarations = new TreeSet<ImportDeclaration>(comparator);
for (String importName : imports) {
ImportDeclaration importDeclaration = ast.newImportDeclaration();
importDeclaration.setName(ast.newName(importName));
importDeclaration.setStatic(staticImports);
importDeclarations.add(importDeclaration);
}
addImports(rewrite, compilationUnit, importDeclarations);
}