private Map<String, Integer> buildExpectedTasksRestarts(Set<String> tasksToFail) {
        Map<String, Integer> expectedTasksRestarts = new HashMap<>();
        for (int i = 0; i < NUM_TASKS; i++) {
            String taskId = taskId(i);
            expectedTasksRestarts.put(taskId, tasksToFail.contains(taskId) ? 1 : 0);
        }
        return expectedTasksRestarts;
    }
Test connectors restart API use cases.
connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectorRestartApiIntegrationTest.java