private static boolean isParameterReference(PsiExpression arg, PsiMethod method) {
    if (!(arg instanceof PsiReferenceExpression)) {
      return false;
    }
    final PsiElement referent = ((PsiReference)arg).resolve();
    if (!(referent instanceof PsiParameter)) {
      return false;
    }
    final PsiElement declarationScope = ((PsiParameter)referent).getDeclarationScope();
    return method.equals(declarationScope);
  }
private static boolean isParameterReference(PsiExpression arg, PsiMethod method)