### Question:
WorkerLauncher { public void startAllWorkers() throws EngineException { startSomeWorkers(m_workers.length - m_nextWorkerIndex); } WorkerLauncher(int numberOfWorkers,
                        WorkerFactory workerFactory,
                        Condition notifyOnFinish,
                        Logger logger);   WorkerLauncher(ExecutorService executor,
                 int numberOfWorkers,
                 WorkerFactory workerFactory,
                 Condition notifyOnFinish,
                 Logger logger); void startAllWorkers(); boolean startSomeWorkers(int numberOfWorkers); boolean allFinished(); void shutdown(); void dontStartAnyMore(); void destroyAllWorkers();  }### Answer:
@Test public void testInteruptedWaitFor() throws Exception { final WorkerIdentity workerIdentity = new AgentIdentityImplementation("test").createWorkerIdentity(); final WorkerFactory workerFactory = mock(WorkerFactory.class); final Worker worker = mock(Worker.class); when(worker.getIdentity()).thenReturn(workerIdentity); when(workerFactory.create(isA(OutputStream.class), isA(OutputStream.class))).thenReturn(worker); final WorkerLauncher workerLauncher = new WorkerLauncher(1, workerFactory, m_condition, m_logger); doThrow(new UncheckedInterruptedException(new InterruptedException())) .when(worker).waitFor(); workerLauncher.startAllWorkers(); verify(worker).getIdentity(); verify(worker, timeout(1000)).waitFor(); verify(worker, timeout(1000)).destroy(); verifyNoMoreInteractions(worker); }