Check out tiny-q. (Note that you currently can't download it.)
Here's an example adapted the above link:
First we need a collection of some data, let's say a set of strings
String[] strings = { "bla", "mla", "bura", "bala", "mura", "buma" };
Now we want to select only the strings which start with "b":
Query<String> stringsStartingWithB = new Query<String>(strings).where(
new Query.Func<String, Boolean>(){
public Boolean run(String in) {
return in.startsWith("b");
}
}
);
No actual data moved copied or anything like that, it will get processed as soon as you start iterating:
for(String string : stringsStartingWithB ) {
System.out.println(string);
}