I would like to know how do I convert the following lambda expression to a for-each loop:
private static List<GrantedAuthority> mapToGrantedAuthorities(List<Authority> authorities) {
return authorities.stream()
.map(authority -> new SimpleGrantedAuthority(authority.getName().name()))
.collect(Collectors.toList());
}