private void setEnvironmentProperty(String name, String value) {
        if (StringUtils.hasText(value)) {
            this.environment.put(name, value);
        } else {
            this.environment.remove(name);
        }
    }
Will apply the value to the environment attribute if and only if the value is not null or empty.  If it is
null or empty, the corresponding environment attribute will be removed.

@param name  the environment property key
@param value the environment property value.  A null/empty value will trigger removal.
core/src/main/java/org/apache/shiro/realm/ldap/JndiLdapContextFactory.java