checkIterator

fun <T> checkIterator(iterator: MutableIterator<T>, expectedSize: Long, allowNull: Boolean)

Checks that the provided iterator is well-formed.

  • is read-only: does not allow remove

  • returns expectedSize number of elements

  • does not return null elements, unless allowNull is true.

  • throws NoSuchElementException if next is called after hasNext returns false.


fun <T> checkIterator(iterator: MutableIterator<T?>)

Checks that the provided iterator is well-formed.

  • is read-only: does not allow remove

  • does not return null elements.

  • throws NoSuchElementException if next is called after hasNext returns false.