GrNewExpression (@Nullable PsiElement position) { if (position == null) return null; final PsiElement reference = position.getParent(); if (!(reference instanceof GrCodeReferenceElement)) return null; PsiElement parent = reference.getParent(); while (parent instanceof GrCodeReferenceElement) parent = parent.getParent(); if (parent instanceof GrAnonymousClassDefinition) parent = parent.getParent(); return parent instanceof GrNewExpression ? (GrNewExpression)parent : null; }