Comparator<PyImportStatementBase> (@NotNull PsiFile settingsAnchor) { return (import1, import2) -> { final Comparator<String> stringComparator = getImportTextComparator(settingsAnchor); return ContainerUtil.compareLexicographically(getSortNames(import1), getSortNames(import2), Comparator.nullsFirst(stringComparator)); }; }