You need to create a prepared parallel LongStream for filtering prime numbers in the given range (inclusive both borders). After calling the count() method it should return the count of prime numbers in the given range. Pay attention to the method template.
The static method NumberUtils.isPrime(someLong) is already available for you. It returns true if the passed value is prime and false otherwise.
Please, be careful with the
rangeClosed, iterate and limit methods!PS: it's not a very efficient approach for generating prime numbers, it's just an example of parallel calculations with streams.