CompilationUnit astRoot = SharedASTProvider
.getAST(src, SharedASTProvider.WAIT_YES, null);
String[] typeNames = types != null ? StringUtils.split(types, ',') : null;
ChooseImports query = new ChooseImports(project, typeNames);
CodeGenerationSettings settings = JavaPreferencesSettings
.getCodeGenerationSettings(src.getJavaProject());
OrganizeImportsOperation op = new OrganizeImportsOperation(
src, astRoot, settings.importIgnoreLowercase, true /* save */, true, query);
TextEdit edit = op.createTextEdit(null);