public static void setResources(Map<Object, Object> newResources) {
        if (CollectionUtils.isEmpty(newResources)) {
            return;
        }
        ensureResourcesInitialized();
        RESOURCES.get().clear();
        RESOURCES.get().putAll(newResources);
    }
Allows a caller to explicitly set the entire resource map.  This operation overwrites everything that existed
previously in the ThreadContext - if you need to retain what was on the thread prior to calling this method,
call the {@link #getResources()} method, which will give you the existing state.

@param newResources the resources to replace the existing {@link #getResources() resources}.
@since 1.0
core/src/main/java/org/apache/shiro/util/ThreadContext.java