public int CompareTo(object obj) { if (!(obj is AccountNumber)) throw new ArgumentException("obj is not an AccountNumber"); var other = (AccountNumber) obj; return value.CompareTo(other.value); }