This is fine, but it's better to convert to a list and use `assertEquals` because it gives a better error message on failure (shows which elements are not equal).