public void stopAndAwaitTask(ConnectorTaskId taskId) {
        stopTask(taskId);
        awaitStopTasks(Collections.singletonList(taskId));
    }
Stop a task that belongs to this worker and await its termination.

@param taskId the ID of the task to be stopped.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java