void (PsiJavaFile file, String fqn, String... expectedOrder) { JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(file); ImportHelper importHelper = new ImportHelper(settings); PsiClass psiClass = JavaPsiFacade.getInstance(getProject()).findClass(fqn, GlobalSearchScope.allScope(getProject())); boolean b = importHelper.addImport(file, psiClass); assertTrue(b); assertOrder(file, expectedOrder); }