public function testExists() { $existClosure = function ($key, $value) { if ($value instanceof Base && $key === 1) { return true; } else { return false; } }; $this->assertTrue($this->arrayCollection->exists($existClosure)); $notExistClosure = function ($key, $value) { if ($value instanceof Base && $key === 67) { return true; } else { return false; } }; $this->assertFalse($this->arrayCollection->exists($notExistClosure)); }