public function remove($element) : bool
    {
        if (!$this->contains($element)) {
            return false;
        }
        $index = array_search($element, $this->elements, true);
        unset($this->elements[$index]);

        return !$this->contains($element);
    }