private boolean sameOffsetTopicAsWorker(String offsetsTopic, Map<String, Object> producerProps) {
        // We can check the offset topic name and the Kafka cluster's bootstrap servers,
        // although this isn't exact and can lead to some false negatives if the user
        // provides an overridden bootstrap servers value for their producer that is different than
        // the worker's but still resolves to the same Kafka cluster used by the worker.
        // At the moment this is probably adequate, especially since we don't want to put
        // a network ping to a remote Kafka cluster inside the herder's tick thread (which is where this
        // logic takes place right now) in case that takes a while.
        Set<String> workerBootstrapServers = new HashSet<>(config.getList(BOOTSTRAP_SERVERS_CONFIG));
        Set<String> producerBootstrapServers = new HashSet<>();
        try {
            String rawBootstrapServers = producerProps.getOrDefault(BOOTSTRAP_SERVERS_CONFIG, "").toString();
            @SuppressWarnings("unchecked")
            List<String> parsedBootstrapServers = (List<String>) ConfigDef.parseType(BOOTSTRAP_SERVERS_CONFIG, rawBootstrapServers, ConfigDef.Type.LIST);
            producerBootstrapServers.addAll(parsedBootstrapServers);
        } catch (Exception e) {
            // Should never happen by this point, but if it does, make sure to present a readable error message to the user
            throw new ConnectException("Failed to parse bootstrap servers property in producer config", e);
        }
        return offsetsTopic.equals(config.offsetsTopic())
                && workerBootstrapServers.equals(producerBootstrapServers);
    }
Gives a best-effort guess for whether the given offsets topic is the same topic as the worker-global offsets topic.
Even if the name of the topic is the same as the name of the worker's offsets topic, the two may still be different topics
if the connector is configured to produce to a different Kafka cluster than the one that hosts the worker's offsets topic.
@param offsetsTopic the name of the offsets topic for the connector
@param producerProps the producer configuration for the connector
@return whether it appears that the connector's offsets topic is the same topic as the worker-global offsets topic.
If {@code true}, it is guaranteed that the two are the same;
if {@code false}, it is likely but not guaranteed that the two are not the same
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java