did not work for me after upgrading to 3.1.0
reason: i added some role manually in my own UserDetails like this:
GrantedAuthority granted = new GrantedAuthorityImpl(rolle.toString());
GrantedAuthorityImpl is deprecated and ifAllGranted, too. But i think it is still a bug.
You can fix it by using simpleGrantedAuthority
GrantedAuthority granted = new SimpleGrantedAuthority(rolle.toString());
the bug is somewhere in the Collection class in an equals method. It checks if the containing element is of class SimpleGrantedAuthority.