@Override
  public void waitForUpdate() {
    assert !ApplicationManager.getApplication().isReadAccessAllowed();
    CountDownLatch waiter = new CountDownLatch(1);
    invokeAfterUpdate(false, waiter::countDown);
    awaitWithCheckCanceled(waiter);
  }
@Override
  public void waitForUpdate()