A cautionary tale: not all TreeSets are equal, but some are more equal than others.pic.twitter.com/mMC4bVJFwe
You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more
I didn't need to look... what it's doing is as reasonable as what I'm doing is unreasonable: the Ordering I created considers there to be no difference in order between two Foos with the same id. The logic inside TreeSet uses that to equality-of-order to infer equality.
In terms of efficiency, that's a reasonable thing to do because the Ordering and an equals method may both be expensive and should probably do the same thing.
But in my real-world use-case I was exploiting this as a convenient way of guaranteeing I never had two elements with the same ID in the same TreeSet (and giving the TreeSet's append method "replace semantics" for free).
Yeah, but it seems to me to make sense to compare the whole value in each position, not just that which determines the order
For most other collections, it would. But people could justifiably complain about TreeSets doing twice as much work as necessary for the common cases, then.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.