ActorThreadPoolThreadsFactory implements ThreadFactory { @Override public Thread newThread(Runnable r) { return new Thread(r, mName); } ActorThreadPoolThreadsFactory(@NonNull String name); @Override Thread newThread(Runnable r);  }
@Test public void threadCreateTest() throws Exception { final Runnable runnable = Mockito.mock(Runnable.class); final ActorThreadPoolThreadsFactory factory = new ActorThreadPoolThreadsFactory("test-thread"); Thread thread = factory.newThread(runnable); Assert.assertEquals("test-thread", thread.getName()); thread.run(); Mockito.verify(runnable).run(); }