I've inherited a team and a (Java) code base.
The code base makes use of a lot of explicit for each
loops. I'd like to replace those (edit: in future code) with something like Commons Collections Transformers and Predicates and its collect and transform methods.
However, Commons Collection isn't generic. The rest of my code base, whatever else it lacks, is, and I don't want to introduce a lot of casting.
So I'm looking at the Commons-Collections with Generics (http://sourceforge.net/projects/collections/) and at Guava (formerly Google Collections) (http://code.google.com/p/guava-libraries/).
Question one: is either or both of those libraries Generally Recognized As Safe for production use? Do you use either in production?
Question two: of the two, which do you recommend? Answers from anyone who has used either are great, answers from anyone who has used both even better!
Finally, my team includes a mix of contractors who are mid- to senior-level, and employees who are mid- and junior-level in Java (edit: but with multi-year experience in non-OO programming) . So I don't want to introduce more than one collections library, and I do want one that won't be too hard for any of my team to use.
Thanks!
Edit: I want to replace explicit loops because the amount of boilerplate obscures and overwhelms the actual business code. I've got nested loops calling functions with nested loops, all to do things that are one-liners. With the proper introduction and training, I feel my team will find a Collections/Transformer/Predicate approach cleaner, clearer, faster to write, and easier to read.