code: def test_next_tick_callback_works() -> None:
      d = locking.UnlockedDocumentProxy(Document())
      assert curdoc() is not d
      curdoc_from_cb: list[Document] = []
  
      def cb():
          curdoc_from_cb.append(curdoc())
  
      callback_obj = d.add_next_tick_callback(cb)
      callback_obj.callback()
      assert len(curdoc_from_cb) == 1
      assert curdoc_from_cb[0] is d._doc
  
      def cb2():
          pass
  
      callback_obj = d.add_next_tick_callback(cb2)
      d.remove_next_tick_callback(callback_obj)
  
file_path: bokeh/tests/unit/bokeh/document/test_locking.py
imports: from __future__ import annotations
  import pytest
  import asyncio
  from bokeh.document.document import Document
  from bokeh.io import curdoc
  import bokeh.document.locking
label_desc: Use image node_id 1 for calling a global function with example usage: test_next_tick_callback_works() without return types