SimpleThread extends Thread { public SimpleThread() { super(Integer.toString(++threadCount)); start(); } SimpleThread(); String toString(); void run(); static void main(String[] args);  }
@Test public void testSimpleThread() { for (int i = 0; i < 5; i++) { SimpleThread thread = new SimpleThread(); assertEquals("equal message", "#" + (i + 1) + "(5),", thread.toString()); assertEquals("equal message", Integer.toString(i + 1), thread.getName()); } }