boolean (PsiElement statement) { PsiElement parent = statement.getParent(); while (parent != null && !(parent instanceof PsiFile)) { if (parent instanceof GrMember) { return ((GrMember) parent).hasModifierProperty(PsiModifier.STATIC); } parent = parent.getParent(); } return false; }