List<PsiElement> (@NotNull List<UsageInfo> usageInfos, @NotNull Project project) { final List<PsiElement> importStatements = new ArrayList<>(); if (!CodeStyleSettingsManager.getSettings(project).getCustomSettings(GroovyCodeStyleSettings.class).INSERT_INNER_CLASS_IMPORTS) { filterUsagesInImportStatements(usageInfos, importStatements); } else { //rebind imports first usageInfos.sort((o1, o2) -> PsiUtil.BY_POSITION.compare(o1.getElement(), o2.getElement())); } return importStatements; }