Check out example codes for "java execute for cycle parallel thread". It will help you in understanding the concepts better.

Code Example 1

fooCollection.parallelStream().forEach(foo -> {
  			//DO things here
            foo.count();
        });

//Check exception version
fooCollection.parallelStream().forEach(foo -> {
  			//DO things here
  			try{
            	foo.count();
            }catch(Exception e){ 
              throw new RuntimeException(e);
            }
        });

Learn ReactJs, React Native from akashmittal.com