Avoid using Array.prototype.indexOf in tests.
Merge pull request #5419 from rwjblue/do-not-use-array-indexof

Avoid using Array.prototype.indexOf in tests.