public void stopAndAwaitTasks() {
        stopAndAwaitTasks(new ArrayList<>(tasks.keySet()));
    }
Stop asynchronously all the worker's tasks and await their termination.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java