text: public override bool Equals(object obj){if (obj == this){return true;}if (obj is AttributeSource other){if (HasAttributes){if (!other.HasAttributes){return false;}if (this.attributeImpls.Count != other.attributeImpls.Count){return false;}State thisState = this.GetCurrentState();State otherState = other.GetCurrentState();while (thisState != null && otherState != null){if (otherState.attribute.GetType() != thisState.attribute.GetType() || !otherState.attribute.Equals(thisState.attribute)){return false;}thisState = thisState.next;otherState = otherState.next;}return true;}else{return !other.HasAttributes;}}else{return false;}}