SimpleThread2 implements Runnable { public SimpleThread2() { Thread.currentThread().setName(Integer.toString(++threadCount)); } SimpleThread2(); String toString(); void run(); static void main(String[] args);  }
@Test public void testSimpleThread2() { for (int i = 0; i < 5; i++) { SimpleThread2 thread = new SimpleThread2(); assertEquals("equal message", "#" + (i + 1) + "(5),", thread.toString()); assertEquals("equal message", Integer.toString(i + 1), Thread.currentThread().getName()); } }