@Test void testCreateWithThreadGroupByThreadGroupInstance() { ThreadGroup threadGroup = new ThreadGroup("test"); testSubject = new AxonThreadFactory(threadGroup); Thread t1 = testSubject.newThread(new NoOpRunnable()); Thread t2 = testSubject.newThread(new NoOpRunnable()); assertEquals("test", t1.getThreadGroup().getName()); assertEquals("test-0", t1.getName()); assertSame(threadGroup, t1.getThreadGroup(), "Expected only a single ThreadGroup"); assertSame(threadGroup, t2.getThreadGroup(), "Expected only a single ThreadGroup"); }
@Override public Thread newThread(Runnable r) { Thread thread = new Thread(threadGroup, r, threadGroup.getName() + "-" + nextThreadNumber()); thread.setPriority(priority); return thread; }
AxonThreadFactory implements ThreadFactory { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(threadGroup, r, threadGroup.getName() + "-" + nextThreadNumber()); thread.setPriority(priority); return thread; } }
AxonThreadFactory implements ThreadFactory { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(threadGroup, r, threadGroup.getName() + "-" + nextThreadNumber()); thread.setPriority(priority); return thread; } AxonThreadFactory(String groupName);  AxonThreadFactory(ThreadGroup group);  AxonThreadFactory(int priority, ThreadGroup group); }
AxonThreadFactory implements ThreadFactory { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(threadGroup, r, threadGroup.getName() + "-" + nextThreadNumber()); thread.setPriority(priority); return thread; } AxonThreadFactory(String groupName);  AxonThreadFactory(ThreadGroup group);  AxonThreadFactory(int priority, ThreadGroup group); @Override Thread newThread(Runnable r); }
AxonThreadFactory implements ThreadFactory { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(threadGroup, r, threadGroup.getName() + "-" + nextThreadNumber()); thread.setPriority(priority); return thread; } AxonThreadFactory(String groupName);  AxonThreadFactory(ThreadGroup group);  AxonThreadFactory(int priority, ThreadGroup group); @Override Thread newThread(Runnable r);  }