NexusForkJoinPoolFactory { public static ForkJoinPool createForkJoinPool(final String threadNamePrefix) { NexusForkJoinWorkerThreadFactory nexusForkJoinWorkerThreadFactory = new NexusForkJoinWorkerThreadFactory(threadNamePrefix); return new ForkJoinPool(Math.min(MAX_CAP, Runtime.getRuntime().availableProcessors()), nexusForkJoinWorkerThreadFactory, null, false); } private  NexusForkJoinPoolFactory(); static ForkJoinPool createForkJoinPool(final String threadNamePrefix);  }
@Test public void threadsHaveCustomPrefix() { ForkJoinPool forkJoinPool = NexusForkJoinPoolFactory.createForkJoinPool("custom-prefix-test-"); ForkJoinWorkerThread thread = forkJoinPool.getFactory().newThread(forkJoinPool); assertThat(thread.getName(), CoreMatchers.containsString("custom-prefix-test-")); }