In my application I use 3rd party library (Spring Data for MongoDB to be exact).
Methods of this library return Iterable<T>
, while the rest of my code expects Collection<T>
.
Is there any utility method somewhere that will let me quickly convert one to the other? I would like to avoid creating a bunch of foreach
loops in my code for such a simple thing.