boolean (PsiElement @NotNull [] occurrences, PsiElement scope) { if (occurrences.length == 0) return true; GrMember container = GrIntroduceFieldHandler.getContainer(occurrences[0], scope); if (container == null) return false; for (int i = 1; i < occurrences.length; i++) { GrMember other = GrIntroduceFieldHandler.getContainer(occurrences[i], scope); if (other != container) return false; } return true; }