public @Nullable PsiVariable getDeclaration(@NotNull PsiElement endPositionElement) {
    final PsiVariable localVariable = getLocalDeclaration(endPositionElement);
    if (localVariable != null) {
      return localVariable;
    }
    return getParameterDeclaration();
  }
public @Nullable PsiVariable getDeclaration(@NotNull PsiElement endPositionElement)