public function testToArray() { $stream = new Stream([1, 2, 3, 4, 5, 6]); $result = $stream->skip(4)->toArray(); $this->assertEquals([4 => 5, 5 => 6], $result); $this->assertEquals([5, 6], $stream->skip(4)->toArray(false)); }