// override object.Equals public override bool Equals(object obj) { if (obj == null || !(obj is MailboxBase)) { return(false); } var other = (MailboxBase)obj; if (!Account.Equals(other.Account) || !Address.Equals(other.Address) || Aliases.Count != other.Aliases.Count) { return(false); } for (var i = 0; i < Aliases.Count; i++) { if (!other.Aliases.Contains(Aliases.ElementAt(i))) { return(false); } } return(true); }