public function testMap() { $xs = new MyArray(array(1, 2, 3)); $twice = function ($x) { return $x * 2; }; $shouldBe = array(2, 4, 6); $result = $xs->map($twice)->toList(); $this->assertEquals($shouldBe, $result); }