I want a Collection that stores the 10 most recent history items of something.
When a new item is added, I want to add the item to the beginning of the list and, if the list size is greater than 10, I need to trim the list down.
Further if an item is added to the top of the list that already exists, I want to remove the other instance (or I could simply check during insertion if the item already exists and instead change the order to move it to the top of the list).
I started looking through the fun new types of Queues now available in
Java 5, but I think that's the wrong direction.
There's a good chance I'll end up extending ArrayList but I thought maybe I could get lucky and grab advice from a Collections guru.