@ApiStatus.Internal
  public static void forceLeaveAllModals() {
    ThreadingAssertions.assertEventDispatchThread();
    ModalityStateEx currentState = getCurrentModalityState();
    if (currentState != ModalityState.nonModal()) {
      currentState.cancelAllEntities();
      // let event queue pump once before trying to cancel next modal
      invokeLater(ModalityState.any(), Conditions.alwaysFalse(), () -> forceLeaveAllModals());
    }
  }
@ApiStatus.Internal
  public static void forceLeaveAllModals()