private static Cache<String, Map<String, List<Object>>> initializeCache(
        final RegisteredServicePrincipalAttributesRepository repository) {
        val cachedRepository = (CachingPrincipalAttributesRepository) repository;
        val unit = TimeUnit.valueOf(StringUtils.defaultIfBlank(cachedRepository.getTimeUnit(), DEFAULT_CACHE_EXPIRATION_UNIT));
        return Caffeine.newBuilder()
            .initialCapacity(DEFAULT_MAXIMUM_CACHE_SIZE)
            .maximumSize(DEFAULT_MAXIMUM_CACHE_SIZE)
            .expireAfterWrite(cachedRepository.getExpiration(), unit)
            .build(s -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER));
    }
This is {@link DefaultPrincipalAttributesRepositoryCache}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/authentication/principal/cache/DefaultPrincipalAttributesRepositoryCache.java