private boolean isReferenced(@Nullable PsiVariable variable, PsiVariable fromVariable) {
    return variable == fromVariable || // it's a freshlyDeclaredParameter
           variable != null && ReferencesSearch.search(variable, new LocalSearchScope(myElements)).findFirst() != null;
  }
private boolean isReferenced(@Nullable PsiVariable variable, PsiVariable fromVariable)