Added permutation test with thread pool