private static @NotNull ExternalSystemTaskNotificationEvent convertTaskProgressEvent(
    @NotNull TaskProgressEvent event,
    @NotNull ExternalSystemTaskId taskId,
    @NotNull String operationId
  ) {
    var eventId = createEventId(event.getDescriptor(), operationId);
    var eventTime = event.getEventTime();
    var message = event.getDescriptor().getName();

    if (event instanceof TaskStartEvent) {
      return new ExternalSystemBuildEvent(taskId, new StartEventImpl(eventId, taskId, eventTime, message));
    }
    else if (event instanceof TaskFinishEvent finishEvent) {
      var result = finishEvent.getResult();
      var eventResult = convertTaskProgressEventResult(result);
      if (eventResult != null) {
        return new ExternalSystemBuildEvent(taskId, new FinishEventImpl(eventId, taskId, eventTime, message, eventResult));
      }
    }
    else if (event instanceof StatusEvent statusEvent) {
      var total = statusEvent.getTotal();
      var progress = statusEvent.getProgress();
      var unit = statusEvent.getUnit();
      return new ExternalSystemBuildEvent(taskId, new ProgressBuildEventImpl(eventId, taskId, eventTime, message, total, progress, unit));
    }
    LOG.warn("Undefined Gradle event " + event.getClass().getSimpleName() + " " + event);
    var description = event.getDescriptor().getName();
    return new ExternalSystemTaskNotificationEvent(taskId, description);
  }
private static @NotNull ExternalSystemTaskNotificationEvent convertTaskProgressEvent(
    @NotNull TaskProgressEvent event,
    @NotNull ExternalSystemTaskId taskId,
    @NotNull String operationId
  )