public function testThatListCanBeCastToArray()
 {
     $items = ["a", null, ["a", "b", "c"], new Exception("message"), new \ArrayObject(["an array", "of", "values"])];
     $cast = CollectionUtility::castToArray($items, function ($value) {
         if ($value instanceof Exception) {
             return [$value->getMessage()];
         }
         return (array) $value;
     });
     $this->assertEquals([["a"], [], ["a", "b", "c"], ["message"], ["an array", "of", "values"]], $cast);
 }