GitThreadFactory implements ForkJoinWorkerThreadFactory { @Override public ForkJoinWorkerThread newThread(ForkJoinPool pool) { ForkJoinWorkerThread thread = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool); thread.setName(NAME_PREFIX + i++); return thread; }  @Override ForkJoinWorkerThread newThread(ForkJoinPool pool);  }
@Test public void testName() { GitThreadFactory factory = new GitThreadFactory(); ForkJoinPool pool = new ForkJoinPool(); assertThat(factory.newThread(pool).getName()).isEqualTo("git-scm-0"); assertThat(factory.newThread(pool).getName()).isEqualTo("git-scm-1"); }