public function filter(callable $condition) { $items = []; foreach ($this->items as $item) { if ($condition($item)) { $items[] = $item; } } $col = new static($this->type); $col->setItemsFromTrustedSource($items); return $col; }