private static HotSwapProgressImpl.HotSwapProgressListener delegatingTo(
    HotSwapStatusListener statusListener, @NotNull List<DebuggerSession> sessions, HotSwapProgressImpl progress
  ) {
    return new HotSwapProgressImpl.HotSwapProgressListener() {
      @Override
      public void onCancel() {
        statusListener.onCancel(sessions);
      }

      @Override
      public void onFinish() {
        if (progress.getMessages(MessageCategory.ERROR).isEmpty()) {
          statusListener.onSuccess(sessions);
        }
        else {
          statusListener.onFailure(sessions);
        }
      }
    };
  }
private static HotSwapProgressImpl.HotSwapProgressListener delegatingTo(
    HotSwapStatusListener statusListener, @NotNull List<DebuggerSession> sessions, HotSwapProgressImpl progress
  )