public function shrink(GeneratedValue $set)
{
// TODO: see SetGenerator::shrink()
if (!$this->contains($set)) {
throw new DomainException('Cannot shrink {' . var_export($set, true) . '} because ' . 'it does not belong to the domain of this set');
}
if (count($set->unbox()) === 0) {
return $set;
}
$input = $set->input();
// TODO: make deterministic by returning an array of GeneratedValues
$indexOfElementToRemove = array_rand($input);
unset($input[$indexOfElementToRemove]);
return GeneratedValue::fromJustValue(array_values($input), 'subset');
}