1fooCollection.parallelStream().forEach(foo -> {
2 //DO things here
3 foo.count();
4 });
5
6//Check exception version
7fooCollection.parallelStream().forEach(foo -> {
8 //DO things here
9 try{
10 foo.count();
11 }catch(Exception e){
12 throw new RuntimeException(e);
13 }
14 });