code: public void closeAllWindowsAndSwitchTo(String key) throws TechnicalException, FailureException {
          String openedWindows = "";
          String handleToKeep = Context.getWindow(key);
          try {
              if (Context.getWindows().size() > 1) {
                  closeAllWindows(handleToKeep);
              }
              Context.getWindows().clear();
              if (handleToKeep != null) {
                  switchToWindow(key, handleToKeep);
              } else {
                  goToUrl(Context.getApplication(key).getHomeKey(), true);
              }
          } catch (Exception e) {
              new Result.Failure<>(e.getMessage(), Messages.format(Messages.getMessage(Messages.FAIL_MESSAGE_UNABLE_TO_CLOSE_APP), openedWindows), true,
                      Context.getCallBack(Callbacks.RESTART_WEB_DRIVER));
          }
      }
docs: Closes all windows except the given one.
  This method is called by reflexion from @see exceptions.ExceptionCallback#getCallBack(String).
  
  @param key
  window key to keep
  @throws TechnicalException
  is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
  Exception with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_CLOSE_APP} message (with screenshot, with exception)
  @throws FailureException
  if the scenario encounters a functional error