code: def test_adding_next_tick_from_another_thread(self) -> None:
      # The test has probabilistic nature - there's a slight change it'll give a false negative
      with LoopAndGroup(quit_after=15) as ctx:
          n = 1000
          func = _make_invocation_counter(ctx.io_loop, stop_after=n)
          tpe = ThreadPoolExecutor(n)
  
          def make_cb(cb):
              return ctx.group.add_next_tick_callback(
                  cb, callback_id=make_id()
              )
  
          list(tpe.map(make_cb, repeat(func, n)))
      assert n == func.count()
  
imports: from __future__ import annotations
  import pytest
  from concurrent.futures import ThreadPoolExecutor
  from itertools import repeat
  from tornado.ioloop import IOLoop
  from bokeh.util.serialization import make_id
  from bokeh.util.tornado import _CallbackGroup
label_desc: Use image node_id 15 for calling the TestCallbackGroup obj's underlying member method code with example usage: obj.test_adding_next_tick_from_another_thread() and returns: ctx