PsiMethodCallExpression (@NotNull PsiElement element) { if (element instanceof PsiReferenceExpression) { return ObjectUtils.tryCast(element.getParent(), PsiMethodCallExpression.class); } if (element instanceof PsiIdentifier) { return getMethodCall(element.getParent()); } return null; }