public void setObject(String name, Object instance) {
        if (name == null) {
            throw new NullPointerException("name parameter cannot be null.");
        }
        if (instance == null) {
            this.objects.remove(name);
        } else {
            this.objects.put(name, instance);
        }
    }
Returns the live (modifiable) internal objects collection.

@return the live (modifiable) internal objects collection.
core/src/main/java/org/apache/shiro/env/DefaultEnvironment.java