public function random($amount = 1)
{
if ($amount > ($count = $this->count())) {
throw new InvalidArgumentException("You requested {$amount} items, but there are only {$count} items in the collection");
}
$keys = array_rand($this->items, $amount);
if ($amount == 1) {
return $this->items[$keys];
}
return new static(array_intersect_key($this->items, array_flip($keys)));
}