The Revolving HashSet
A project I was working on had a fairly unique storage requirement: I needed a storage medium in which I could query its contents VERY quickly with Contains(), even when the set was relatively large; and when it reached a set size, it should start replacing its oldest values with incoming values – essentially a queue where the oldest values get trimmed once the queue reaches a certain size. Lets take a look at the solution achieved.