boolean (@NotNull PsiMethod left, @NotNull PsiMethod right) { if (PsiUtil.getAccessLevel(left.getModifierList()) > PsiUtil.getAccessLevel(right.getModifierList())) return true; if (!left.getContainingClass().isInterface()) return true; if (!right.getContainingClass().isInterface()) return false; // implement annotated method PsiAnnotation[] leftAnnotations = left.getModifierList().getAnnotations(); PsiAnnotation[] rightAnnotations = right.getModifierList().getAnnotations(); return leftAnnotations.length > rightAnnotations.length; }