In the final comparison return collect.size() == 0; it should be return collect.size() == TestPrime.numberOfThread.intValue(); since the filter predicate lets all parts pass that succeeded the isPrime() test. So if all threads pass it, it's a prime.
Test it with a simple number, e.g. "19" and it would return false.
In the final comparison
return collect.size() == 0;it should bereturn collect.size() == TestPrime.numberOfThread.intValue();since the filter predicate lets all parts pass that succeeded the isPrime() test. So if all threads pass it, it's a prime.Test it with a simple number, e.g. "19" and it would return false.