Use foreach where possible

This commit is contained in:
Lars Grefer
2019-07-04 19:16:52 +02:00
committed by Josh Cummings
parent 7dc28ff376
commit 43737a56bd
7 changed files with 24 additions and 26 deletions

View File

@@ -128,8 +128,8 @@ public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests {
Collection<String> expectedRolesColl = Arrays.asList(expectedRoles);
Collection<String> gasRolesSet = new HashSet<>();
for (int i = 0; i < gas.size(); i++) {
gasRolesSet.add(gas.get(i).getAuthority());
for (GrantedAuthority grantedAuthority : gas) {
gasRolesSet.add(grantedAuthority.getAuthority());
}
assertThat(expectedRolesColl.containsAll(gasRolesSet)
&& gasRolesSet.containsAll(expectedRolesColl)).withFailMessage(