public ThreadContextHandle addThreadContext(final String name) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("The name is null or zero length.");
        }
        if (getThreadContextHandle(name) != null) {
            throw new IllegalArgumentException("The name has been used.");
        }

        final ThreadContextHandle handle = new ThreadContextHandle(name, nextThreadId);
        CollectionUtil.expandArrayListSize(threadContexts, nextThreadId);
        threadContexts.set(nextThreadId, handle);
        nextThreadId++;
        return handle;
    }