I need to implement a very efficient method of checking if a certain key (long value) is present in a small collection of items (less than 100, usually around 10) in java.

This check must be as efficient as possible, as it is going to be made several times per second (more than 1000, I'm treating an Multicast feed and i want to discard messages that i don't need to treat).

The items that need to be checked is going to vary almost nothing during the application life cycle, and it can be expensive in terms of performance.

Thanks

> 
> Thanks for all the prompt replies. My concern is that my long keys might be very concentrated in a small range of the long, and I'm worried about it. If you guys think that it wont be an issue, I'll give it a try.
> 
> 
>