private static String stateSummary(ConnectorStateInfo info) {
        String result = "the connector was " + info.connector().state();
        if (info.tasks().isEmpty()) {
            return result + " and no tasks were running";
        } else {
            String taskStates = info.tasks().stream()
                    .map(ConnectorStateInfo.TaskState::state)
                    .collect(Collectors.joining(", "));
            return result + " and its tasks were in these states: " + taskStates;
        }
    }
Check whether a connector's set of active topics matches the given collection of topic names.

@param connectorName the connector name
@param topics a collection of topics to compare against
@return true if the connector's active topics matches the given collection; false otherwise
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/ConnectAssertions.java