simulator/src/main/java/com/hazelcast/simulator/utils/ThreadSpawner.java
public Thread spawn(String namePrefix, Runnable runnable) {
        checkNotNull(namePrefix, "namePrefix can't be null");
        checkNotNull(runnable, "runnable can't be null");

        String name = newName(namePrefix);
        Thread thread;
        if (throwException) {
            thread = new ThrowExceptionThread(name, runnable);
            thread.setUncaughtExceptionHandler(exceptionHandler);
        } else {
            thread = new ReportExceptionThread(testId, name, runnable);
        }
        threads.add(thread);
        thread.start();
        return thread;
    }
public Thread spawn(String namePrefix, Runnable runnable) {
        checkNotNull(namePrefix, "namePrefix can't be null");
        checkNotNull(runnable, "runnable can't be null");

        String name = newName(namePrefix);
        Thread thread;
        if (throwException) {
            thread = new ThrowExceptionThread(name, runnable);
            thread.setUncaughtExceptionHandler(exceptionHandler);
        } else {
            thread = new ReportExceptionThread(testId, name, runnable);
        }
        threads.add(thread);
        thread.start();
        return thread;
    }
Spawns a new thread for the given {@link Runnable}.

@param namePrefix the name prefix for the thread
@param runnable   the {@link Runnable} to execute
@return the created thread