@Override
    public int compareTo(final TaskId other) {
        if (topologyName != null && other.topologyName != null) {
            final int comparingNamedTopologies = topologyName.compareTo(other.topologyName);
            if (comparingNamedTopologies != 0) {
                return comparingNamedTopologies;
            }
        } else if (topologyName != null || other.topologyName != null) {
            LOG.error("Tried to compare this = {} with other = {}, but only one had a valid named topology", this, other);
            throw new IllegalStateException("Can't compare a TaskId with a namedTopology to one without");
        }
        final int comparingTopicGroupId = Integer.compare(this.topicGroupId, other.topicGroupId);
        return comparingTopicGroupId != 0 ? comparingTopicGroupId : Integer.compare(this.partition, other.partition);
    }
@deprecated since 3.0, for internal use, will be removed
streams/src/main/java/org/apache/kafka/streams/processor/TaskId.java