public static <T extends PsiMember & PsiDocCommentOwner> void sortIdenticalShortNamedMembers(@NotNull T @NotNull [] members, @NotNull PsiReference context) {
    if (members.length <= 1) return;

    PsiElement leaf = context.getElement().getFirstChild(); // the same proximity weighers are used in completion, where the leafness is critical
    final Comparator<T> comparator = createSortIdenticalNamedMembersComparator(leaf);
    Arrays.sort(members, comparator);
  }
public static <T extends PsiMember & PsiDocCommentOwner> void sortIdenticalShortNamedMembers(@NotNull T @NotNull [] members, @NotNull PsiReference context)