public function withUnique(Attribute $attr): self
    {
        $obj = clone $this;
        $obj->_attributes = array_filter($obj->_attributes,
            function (Attribute $a) use ($attr) {
                return $a->oid() != $attr->oid();
            });
        $obj->_attributes[] = $attr;
        return $obj;
    }