boolean () { if (!myPySettings.OPTIMIZE_IMPORTS_SORT_IMPORTS) { return false; } final Ordering<PyImportStatementBase> importOrdering = Ordering.from(AddImportHelper.getSameGroupImportsComparator(myFile)); return ContainerUtil.exists(myGroups.values(), imports -> !importOrdering.isOrdered(imports)); }