GrCall (@Nullable PsiElement ref) { if (ref == null) return null; if (ref instanceof GrEnumConstant) return (GrEnumConstant)ref; if (ref instanceof GrConstructorInvocation) return (GrCall)ref; PsiElement parent = ref.getParent(); if (parent instanceof GrCall) { return (GrCall)parent; } else if (parent instanceof GrAnonymousClassDefinition) { return (GrCall)parent.getParent(); } else { return null; } }