code: protected Map<String, List<Object>> convertAttributesToPrincipalAttributesAndCache(final Principal principal,
                                                                                         final Map<String, List<Object>> sourceAttributes,
                                                                                         final RegisteredService registeredService) {
          val finalAttributes = convertPersonAttributesToPrincipalAttributes(sourceAttributes);
          addPrincipalAttributes(principal.getId(), finalAttributes, registeredService);
          return finalAttributes;
      }
docs: Convert attributes to principal attributes and cache.
  
  @param principal         the principal
  @param sourceAttributes  the source attributes
  @param registeredService the registered service
  @return the map