simulator/src/main/java/com/hazelcast/simulator/utils/ThreadSpawner.java
public void awaitCompletion() {
        for (Thread thread : threads) {
            try {
                thread.join();
            } catch (InterruptedException e) {
                throw rethrow(e);
            }
        }
        if (caughtException != null) {
            throw rethrow(caughtException);
        }
    }
public void awaitCompletion() {
        for (Thread thread : threads) {
            try {
                thread.join();
            } catch (InterruptedException e) {
                throw rethrow(e);
            }
        }
        if (caughtException != null) {
            throw rethrow(caughtException);
        }
    }
public void awaitCompletion ( ) { for ( Thread thread : threads ) { try { thread . join ( ) ; } catch ( InterruptedException e ) { throw rethrow ( e ) ; } } if ( caughtException != null ) { throw rethrow ( caughtException ) ; } }
Waits for all threads to finish.

If {@link #throwException} is <code>true</code> this method will throw the first occurred exception of a thread.
Waits for all threads to finish .