Google Guava vs. Apache Commons [closed]

In my opinion the better choice is Guava (formerly known as Google collections):

  • it’s more modern (has generics)
  • it absolutely follows the Collections API requirements
  • it’s actively maintained
  • CacheBuilder and it’s predecessor MapMaker are just plain awesome

Apache Commons Collections is a good library as well, but it has long failed to provide a generics-enabled version (which is a major drawback for a collections API in my opinion) and generally seems to be in a maintenance/don’t-do-too-much-work-on-it mode Recently Commons Collections has picked up some steam again, but it has some catching up to do..

If download size/memory footprint/code size is an issue then Apache Commons Collections might be a better candidate, since it is a common dependency of other libraries. Therefore using it in your own code as well could potentially be done without adding any additional dependencies. Edit: This particular “advantage” has been partially subverted by now, since many new libraries actually depend on Guava and not on Apache Commons Collections.

Leave a Comment