void (final ConflictsCollector collector) { PsiElement[] members = collectPackageLocalMembers(collector.getClassToMove()); for(PsiElement member: members) { ReferencesSearch.search(member).forEach(psiReference -> { PsiElement element = psiReference.getElement(); for (PsiClass psiClass : myClassesToMove) { if (PsiTreeUtil.isAncestor(psiClass, element, false)) return true; } if (isInaccessibleFromTarget(element, PsiModifier.PACKAGE_LOCAL)) { collector.addConflict(psiReference.resolve(), element); } return true; }); } }