boolean (@NotNull PsiField field, PsiClass fromClass) { final PsiClass fieldClass = field.getContainingClass(); if (fieldClass == null) { return false; } if (fieldClass.equals(fromClass)) { return true; } if (field.hasModifierProperty(PsiModifier.PRIVATE)) { return false; } if (field.hasModifierProperty(PsiModifier.PUBLIC) || field.hasModifierProperty(PsiModifier.PROTECTED)) { return true; } return inSamePackage(fieldClass, fromClass); }