core/src/main/java/org/springframework/security/core/authority/mapping/SimpleAuthorityMapper.java
public Set<GrantedAuthority> mapAuthorities(
			Collection<? extends GrantedAuthority> authorities) {
		HashSet<GrantedAuthority> mapped = new HashSet<>(
				authorities.size());
		for (GrantedAuthority authority : authorities) {
			mapped.add(mapAuthority(authority.getAuthority()));
		}

		if (defaultAuthority != null) {
			mapped.add(defaultAuthority);
		}

		return mapped;
	}
public Set<GrantedAuthority> mapAuthorities(
			Collection<? extends GrantedAuthority> authorities) {
		HashSet<GrantedAuthority> mapped = new HashSet<>(
				authorities.size());
		for (GrantedAuthority authority : authorities) {
			mapped.add(mapAuthority(authority.getAuthority()));
		}

		if (defaultAuthority != null) {
			mapped.add(defaultAuthority);
		}

		return mapped;
	}
Creates a mapping of the supplied authorities based on the case-conversion and
prefix settings. The mapping will be one-to-one unless duplicates are produced
during the conversion. If a default authority has been set, this will also be
assigned to each mapping.

@param authorities the original authorities

@return the converted set of authorities