int (@NotNull PsiImportStatementBase statement1, @NotNull PsiImportStatementBase statement2) { int index1 = findEntryIndex(statement1); int index2 = findEntryIndex(statement2); if (index1 == index2) return 0; if (index1 > index2) { int t = index1; index1 = index2; index2 = t; } PackageEntry[] entries = mySettings.IMPORT_LAYOUT_TABLE.getEntries(); int maxSpace = 0; for(int i = index1 + 1; i < index2; i++){ if (entries[i] == PackageEntry.BLANK_LINE_ENTRY){ int space = 0; do{ space++; } while(entries[++i] == PackageEntry.BLANK_LINE_ENTRY); maxSpace = Math.max(maxSpace, space); } } return maxSpace; }