private static void checkNoWriteAccess() {
    Application app = ApplicationManager.getApplication();
    if (!app.isUnitTestMode() && app.isWriteAccessAllowed()) {
      throw new AssertionError("Completion should not be invoked inside write action");
    }
  }
private static void checkNoWriteAccess()