ForkJoinPool forkJoinPool = new ForkJoinPool(2);
forkJoinPool.submit(() ->
//parallel task here, for example
IntStream.range(1, 1_000_000).parallel().filter(PrimesPrint::isPrime).collect(toList())
).get();
This post is an overview of the concurrency features of Java 7. This includes the Fork/Join Framework, the TransferQueue and the ThreadLocalRandom class