@Override
  public void queue(@NotNull Update update) {
    boolean passThrough = false;
    if (ApplicationManager.getApplication().isUnitTestMode()) {
      passThrough = isPassThrough();
    } else if (MavenUtil.isNoBackgroundMode()) {
      passThrough = true;
    }

    if (passThrough) {
      update.run();
      return;
    }
    super.queue(update);
  }
 public void makeModalAware(Project project) {
   MavenUtil.invokeAndWait(
       project,
       new Runnable() {
         public void run() {
           final ModalityStateListener listener =
               new ModalityStateListener() {
                 public void beforeModalityStateChanged(boolean entering) {
                   if (entering) {
                     suspend();
                   } else {
                     resume();
                   }
                 }
               };
           LaterInvocator.addModalityStateListener(listener, MavenMergingUpdateQueue.this);
           if (MavenUtil.isInModalContext()) {
             suspend();
           }
         }
       });
 }