Casing to `Collection` rather than `Iterable` would enable us to replace this with `!array.hasNext()`, which would be better than creating an `Iterator` that isn't used.