private void doExpandingCollapsing(@NotNull Runnable task) {
    if (isDisposed()) return;
    ThreadingAssertions.assertEventDispatchThread();
    fireEvents();  // drain all remaining insertion events in the queue

    myExpandingCollapsing = true;
    try {
      task.run();
    }
    finally {
      myExpandingCollapsing = false;
    }
  }
private void doExpandingCollapsing(@NotNull Runnable task)