public function testThatGroupByMaintainsReferences(\Pinq\ITraversable $traversable, array $data) { $data = $this->makeRefs(range(1, 10)); $traversable = $traversable->append($data)->groupBy(function ($i) { return $i % 2 === 0; })[true]->iterate(function (&$i) { $i *= 10; }); $this->assertSame($data, [1, 20, 3, 40, 5, 60, 7, 80, 9, 100]); }