public void clearDocumentQueue() {
    if (changedDocumentExecutor.isEmpty()) {
      return;
    }

    if (ApplicationManager.getApplication().isWriteAccessAllowed()) {
      throw new IllegalStateException("Must not call clearDocumentQueue() from under write action because some queued detectors require read action");
    }

    // after clear and canceling all queued tasks, make sure they all are finished
    //noinspection TestOnlyProblems
    changedDocumentExecutor.cancelAndWaitAllTasksExecuted(1, TimeUnit.MINUTES);
  }
public void clearDocumentQueue()