Let's see this example C# code:
List<int> numbers = new List<int>() { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
int numCount = numbers.Where(n => n < 3 || n > 7).Count();
I'm insterested in cloesest equivalent in Java, obviously without need to write fancy for/foreach loops to iterate in collection.
As far as I know, there is no exact linq equivalnet in Java, however I'm still beginner in Java programming, so is there anything you could recommend for me? I'm actually looking for most compact and elegant way to achieve the same result in Java
[added] So, thanks for all reponses. However, I need to use it on Android and it seem I can't. Is there any solution for that?
(sorry it it's duplicate)
[added] Have anybody tried this? http://sourceforge.net/projects/streamsupport/