protected Integer getKeyHash(final Map<String, Object> seed) {
        val cacheAttributes = determineCacheAttributes(seed);
        val cacheKey = new HashMap<String, Object>(cacheAttributes.size());
        for (val attr : cacheAttributes) {
            if (seed.containsKey(attr)) {
                val value = seed.get(attr);

                if (!this.ignoreEmptyAttributes) {
                    putAttributeInCache(cacheKey, attr, value);
                } else if (value instanceof final Collection c) {
                    if (!CollectionUtils.isEmpty(c)) {
                        putAttributeInCache(cacheKey, attr, value);
                    }
                } else if (value instanceof final CharSequence cs) {
                    if (StringUtils.isNotEmpty(cs)) {
                        putAttributeInCache(cacheKey, attr, value);
                    }
                } else if (value != null) {
                    putAttributeInCache(cacheKey, attr, value);
                }
            }
        }
        LOGGER.debug("Generated cache Map [{}] from seed Map [{}]", cacheKey, seed);
        if (cacheKey.isEmpty()) {
            return null;
        }
        return cacheKey.hashCode();
    }
Gets the hash of the key elements from the seed {@link Map}. The key elements are specified by
the {@code cacheKeyAttributes} {@link Set} or if it is {@code null} the
{@code defaultAttributeName} is used as the key attribute.

@param seed Seed
@return Hash of key elements from the seed
support/cas-server-support-person-directory-core/src/main/java/org/apereo/cas/persondir/cache/AttributeBasedCacheKeyGenerator.java