public boolean conflictsWith(Topic other) {
        int minSize = Math.min(levels.size(), other.levels.size());

        for (int i = 0; i < minSize; i++) {
            Level thisLevel = levels.get(i);
            Level otherLevel = other.levels.get(i);
            // Both are static levels with different values.
            if (!thisLevel.isLabel() && !otherLevel.isLabel()
                    && !thisLevel.getContent().equals(otherLevel.getContent())) {
                return false;
            } else if (thisLevel.isLabel() != otherLevel.isLabel()) {
                // One is static and the other is not, so there is not a
                // conflict. One is more specific than the other.
                return false;
            }
        }

        // At this point, the two patterns are identical. If the segment
        // length is different, then one pattern is more specific than the
        // other, disambiguating them.
        return levels.size() == other.levels.size();
    }
Determines if this topic conflicts with another topic.

@param other Topic to check against.
@return Returns true if there is a conflict.
smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/Topic.java