Should return whether the end of the list has been reached.
bool hasReachedEnd(List<T> list) => list.isEmpty;