>
> Would that change the behavior of the methods?
>
>
> It doesn't seem to as the tests pass if you rename the index temp vars to idx.
>
>
> Why is that?
>
Because shadowing means that the shadowed variable will not be used. Since
those methods don't use the instance variable, it's perfectly fine to
reuse the name "index" instead of "idx" or "i" or whatever.