boolean (PsiReferenceExpression referenceExpression) { final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(referenceExpression, PsiMethodCallExpression.class); if (methodCallExpression == null) { return false; } final PsiExpressionList argumentList = methodCallExpression.getArgumentList(); if (!argumentList.isEmpty()) { return false; } final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final String name = methodExpression.getReferenceName(); return HardcodedMethodConstants.CLOSE.equals(name); }