public function testThatOrderByMaintainsReferences(\Pinq\ITraversable $traversable) { $data = $this->makeRefs(range(1, 100)); $traversable->append($data)->orderByAscending(function ($i) { return (int) ($i / 10); })->thenByDescending(function ($i) { return $i; })->iterate(function (&$i) { $i *= 10; }); $this->assertSame(range(10, 1000, 10), $data); }