boolean (GrReferenceExpression ref, PsiMethod patternMethod) { PsiElement container = PsiTreeUtil.getParentOfType(ref, GrClosableBlock.class, PsiMember.class, PsiFile.class); assert container != null; return checkContainer(patternMethod, container); }