KotlinTest inspectors are an easy way to test the contents of collections. Sometimes, you may wish to assert that only certain elements of a collection should pass an assertion. Other times, you may want no elements to pass an assertion; just one, or two, and so on. Of course, we can do this ourselves by just iterating over the collection and keeping track of how many items have passed the assertions; however, inspectors do this for us.
Let's start with the usual case where we want all the elements of a collection to pass the assertions. For this, first of all, we'll define a list that we'll work with throughout the rest of the section:
val kings = listOf("Stephen I", "Henry I", "Henry II", "Henry III", "William I", "William II")
Then, we'll assert that every king has a regal number...