public void runTests() { List<Thread> threads = new ArrayList<Thread>(); for (final URL baseURL : configuration.getRemoteMachineURLs()) threads.add( new Thread("Run JsUnit tests on " + baseURL) { public void run() { runTestsOnRemoteMachine(baseURL); } }); for (Thread thread : threads) thread.start(); for (Thread thread : threads) { try { thread.join(); } catch (InterruptedException e) { throw new RuntimeException("One of the test threads was interrupted."); } } }