Returns true iff the index is within the capacity of the underlying list.
true
index
bool isIndexWithinBounds(int index) => index < capacity;