void (@NotNull PsiJavaFile file, @NonNls String @NotNull ... expectedOrder) { PsiImportStatementBase[] statements = file.getImportList().getAllImportStatements(); assertEquals(expectedOrder.length, statements.length); for (int i = 0; i < statements.length; i++) { PsiImportStatementBase statement = statements[i]; String text = StringUtil.trimEnd(StringUtil.trimStart(statement.getText(), "import "), ";"); assertEquals(expectedOrder[i], text); } }