Google Guava vs. Apache Commons

Viewed 69147

I was looking for a bidirectional map implementation in Java, and stumbled upon these two libraries:

Both are free, have the bidirectional map implementation that I was looking for (BidiMap in Apache, BiMap in Google), are amazingly nearly the same size (Apache 493 kB, Google 499 kB) [ed.: no longer true!] and seem in all ways pretty similar to me.

Which one should I choose, and why? Are there some other equivalent alternatives (must be free and have at least the bidirectional map)? I'm working with the latest Java SE, so no need to artificially limit to Java 5 or anything like that.

5 Answers

Two other things (I hope I'm not wrong)

  • The licence of Guava (new name for google collections) is the Apache License 2.0, meaning: the same one as for Apache Commons project
  • I cannot find the source code of Guava in a file to download (it seems only a git-access is possible)
Related