code: def test_update_name(self) -> None:
      d = Document()
      dm = d.models
      assert len(dm) == 0
  
      m1 = Div(name="foo")
      m2 = Div()
      m3 = Div(name="bar")
  
      d.add_root(m1)
      d.add_root(m2)
      d.add_root(m3)
  
      assert set(dm.get_all_by_name("foo")) == {m1}
      assert set(dm.get_all_by_name("bar")) == {m3}
  
      dm.update_name(m1, "foo", "baz")
  
      assert set(dm.get_all_by_name("baz")) == {m1}
      assert set(dm.get_all_by_name("foo")) == set()
      assert set(dm.get_all_by_name("bar")) == {m3}
  
      dm.update_name(m2, None, "baz")
      dm.update_name(m3, "bar", "baz")
  
      assert set(dm.get_all_by_name("baz")) == {m1, m2, m3}
      assert set(dm.get_all_by_name("foo")) == set()
      assert set(dm.get_all_by_name("bar")) == set()
  
imports: from __future__ import annotations
  import pytest
  import gc
  from unittest.mock import MagicMock, patch
  from bokeh.core.has_props import Local
  from bokeh.core.properties import Instance, Nullable
  from bokeh.core.types import ID
  from bokeh.document import Document
  from bokeh.model import Model
  from bokeh.models import Div, Row
  import bokeh.document.models
label_desc: Use image node_id 14 for calling the TestDocumentModelManager obj's underlying member method code with example usage: obj.test_update_name() without return types