@Test public void newThreadIsAddedToSetWhenThereAlreadyIsAThreadThatIsNotTerminated() { Thread thread = mock(Thread.class); when(thread.getState()).thenReturn(Thread.State.RUNNABLE); set.addThread(thread); thread = mock(Thread.class); set.addThread(thread); assertEquals(2, getThreads().size()); }
public void addThread(Thread thread) { cleanUp(); threads.add(thread); }
ActiveThreadSet { public void addThread(Thread thread) { cleanUp(); threads.add(thread); } }
ActiveThreadSet { public void addThread(Thread thread) { cleanUp(); threads.add(thread); } ActiveThreadSet(); }
ActiveThreadSet { public void addThread(Thread thread) { cleanUp(); threads.add(thread); } ActiveThreadSet(); void addThread(Thread thread); void joinAll(); }
ActiveThreadSet { public void addThread(Thread thread) { cleanUp(); threads.add(thread); } ActiveThreadSet(); void addThread(Thread thread); void joinAll();  }