public function testChaining() { $expected = new MutableMap('FOO'); $list = new MutableMap('foo', 'bar'); $filter = function ($value) { if (strtolower($value) == 'foo') { return true; } }; $list->map(function ($value) { return strtoupper($value); }); $this->assertEquals($expected->all(), $list->filter($filter)->all()); }