### Question:
JwtAttributeMapper implements AttributeMapper<JwtClaimsSet> { public Map<String, Set<String>> getAttributes(Map<String, String> jwtToLocalAttributeMapping, JwtClaimsSet jwtClaimsSet) { Map<String, Set<String>> lookupAttributes = new HashMap<String, Set<String>>(); if (jwtToLocalAttributeMapping == null || jwtClaimsSet == null) { return lookupAttributes; } for (Map.Entry<String, String> entry : jwtToLocalAttributeMapping.entrySet()) { String jwtName = entry.getKey(); if (jwtClaimsSet.isDefined(jwtName)) { String localName = entry.getValue(); if (!lookupAttributes.containsKey(localName)) { Set<String> value = new HashSet<String>(); String data = jwtClaimsSet.getClaim(jwtName).toString(); if (prefix != null && (prefixedAttributes.contains(localName) || prefixedAttributes.contains("*"))) { data = prefix + data; } lookupAttributes.put(localName, CollectionUtils.asSet(data)); } else { logger.error("In JwtAttributeMapper.getAttributes, the " + "jwtToLocalAttributeMappings appears to have duplicate entries: " + jwtToLocalAttributeMapping + "; Or possibly the JwtClaimsSet has duplicate entries: " + jwtClaimsSet + ". Will preserve the following existing mappings: " + lookupAttributes); } } } return lookupAttributes; } JwtAttributeMapper();  JwtAttributeMapper(String prefixedAttributesList, String prefix); void init(String bundleName); Map<String, Set<String>> getAttributes(Map<String, String> jwtToLocalAttributeMapping,
                                                                    JwtClaimsSet jwtClaimsSet);  }### Answer:
@Test public void testBasicJwtMapping() { final Map<String, Set<String>> attrs = defaultPrincipalMapper.getAttributes(attributeMappings, claimsSet); assertThat(attrs.get(UID).iterator().next()).isEqualTo("prefix-" + SUBJECT_VALUE); assertThat(attrs.get(AM_EMAIL).iterator().next()).isEqualTo(EMAIL_VALUE); }