I’m only started learning guava. So I don’t know best practices and etc. These is code (it binding some classes and put in Order by input collection): So, should I separate it in several operations? upd what does it do? It takes collection. Sorts it. Maps each object to other one. Creates new ImmutableList and return it. Answer I think
Tag: guava
Idiomatic way to use for-each loop given an iterator?
When the enhanced for loop (foreach loop) was added to Java, it was made to work with a target of either an array or Iterable. That works great for Collection classes that only implement one type of iteration, and thus have a single iterator() method. But I find myself incredibly frustrated the odd time I want to use a non-standard
What is the replacement for Sets.newConcurrentHashSet()?
I am upgrading from Google Collections 0.9 to 1.0. It seems Sets.newConcurrentHashSet() is no longer available. I was using it in the following construct: What would be the best replacement for Sets.newConcurrentHashSet() ? Edit: The reason for this construct is to have a multimap that is safe to read and write from multiple threads. It is used in a mostly-read