Java – the most used class in Google collections framework

collectionsentity-frameworkframeworksjava

I wonder what is the most useful class in the Google collections framework?

Best Solution

In my experience, Iterables and Lists.

I use Lists.newArrayList frequently (usually as a static import) and Iterables is the closest that Java gets to LINQ...

Oh, and not particularly collection-y, but Preconditions.checkNotNull is very handy too, again with a static import:

public MyClass (String name, ...)
{
    this.name = checkNotNull(name);
    // etc
}

Then there's all the immutability stuff, multi-maps, MapMaker etc... It's just a great library. KevinB et al rock :)