private Set<String> buildAllTasksToFail() {
        Set<String> tasksToFail = new HashSet<>();
        for (int i = 0; i < NUM_TASKS; i++) {
            String taskId = taskId(i);
            tasksToFail.add(taskId);
        }
        return tasksToFail;
    }
Test connectors restart API use cases.
connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectorRestartApiIntegrationTest.java