For writing custom implementation of UserDetails, why does the getAuthorities method require the collection to be returned to be sorted?
Is it mandatory requirement or just good-to-have-for-performance kind of thing?the authorities, sorted by natural key (never null)
If it is mandatory then why is it not dictated by the type of interface being used for the return type. Instead of Collection<GrantedAuthority> it could have been SortedSet<GrantedAuthority>.
I searched a lot but most of the time i am getting results for older api which used to return the array.
Thanks in advance