One difference between this and `ensureCapacity` is that `ensureCapacity` takes a size, and this takes `size - 1`. I think taking `size - 1` is weird because if the size is 0 then you get an index of `-1` here.