static Map<String, List<Object>> stuffAttributesIntoList(final Map<String, ?> personAttributesMap) {
        val personAttributes = new HashMap<String, List<Object>>();
        for (val stringObjectEntry : personAttributesMap.entrySet()) {
            val value = stringObjectEntry.getValue();
            if (value instanceof final List list && !list.isEmpty()) {
                personAttributes.put(stringObjectEntry.getKey(), list);
            } else if (value != null) {
                personAttributes.put(stringObjectEntry.getKey(), new ArrayList<>(List.of(value)));
            }
        }
        return personAttributes;
    }
Stuff attributes into list.

@param personAttributesMap the person attributes map
@return the map
api/cas-server-core-api-authentication/src/main/java/org/apereo/cas/authentication/principal/attribute/PersonAttributeDao.java