Fix flaky test failure in 'AbstractCollectionTest.testCollectionToArray2'