public override bool EqualsTo(IBaseType value) { // If collection, compare each element if (value is AbstractCollection) { var thisList = AsEnumerable().ToList(); var valueList = (value as AbstractCollection).AsEnumerable().ToList(); if (thisList.Count != valueList.Count) { return false; } for (int i = 0; i < thisList.Count; ++i) { if (thisList[i].NotEqualsTo(valueList[i])) { return false; } } return true; } // else compare by integer (which will mean size) return ToInt() == value.ToInt(); }