assertSame(["abc", "foo", "bar"], yield Iterator\toArray($iterator)); } public function testEmpty(): \Generator { $iterator = Iterator\fromIterable([], 5); $this->assertSame([], yield Iterator\toArray($iterator)); } }