### Question:
XsuaaToken extends Jwt implements Token { @Override public Collection<? extends GrantedAuthority> getAuthorities() { return this.authorities; } protected  XsuaaToken(Jwt jwt); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override Date getExpirationDate(); @Override Instant getExpiration(); @Override String getPassword(); @Override String getUsername(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Nullable static String getUniquePrincipalName(String origin, String userLoginName); @Override @Nullable String getLogonName(); @Override @Nullable String getClientId(); @Override String getGivenName(); @Override @Nullable String getFamilyName(); @Override String getEmail(); @Override String getOrigin(); @Override String getGrantType(); @Override String getSubaccountId(); @Override String getZoneId(); @Override String getSubdomain(); @Override String toString(); @Nullable @Override String[] getXSUserAttribute(String attributeName); @Override String getAdditionalAuthAttribute(String attributeName); @Override String getCloneServiceInstanceId(); @Override String getAppToken(); @Override Collection<String> getScopes(); boolean hasClaim(String claim);  }### Answer:
@Test public void authenticationConverterShouldSetAuthorities() { TokenAuthenticationConverter converter = new TokenAuthenticationConverter(xsAppName); converter.setLocalScopeAsAuthorities(true); List<String> scopesList = new ArrayList<>(); scopesList.add(scopeWrite); scopesList.add(scopeRead); scopesList.add(scopeOther); claimsSetBuilder.claim("scope", scopesList); Jwt jwt = JwtGenerator.createFromClaims(claimsSetBuilder.build()); AuthenticationToken authToken = (AuthenticationToken) converter.convert(jwt); token = (XsuaaToken) authToken.getPrincipal(); Collection<GrantedAuthority> authorities = (Collection<GrantedAuthority>) token.getAuthorities(); assertThat(authorities.size(), is(2)); assertThat(authorities, hasItem(new SimpleGrantedAuthority("Read"))); assertThat(authorities, hasItem(new SimpleGrantedAuthority("Write"))); }
@Test public void getAuthoritiesNoScopeClaimReturnsEmptyList() { claimsSetBuilder.claim(TokenClaims.CLAIM_SCOPES, new ArrayList<>()); token = createToken(claimsSetBuilder); Collection<GrantedAuthority> authorities = (Collection<GrantedAuthority>) token.getAuthorities(); assertThat(authorities.size(), is(0)); }