diff --git a/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/ExternalGroupPrincipalProviderTest.java b/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/ExternalGroupPrincipalProviderTest.java index 838ba958aaf..98c7e6aec4c 100644 --- a/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/ExternalGroupPrincipalProviderTest.java +++ b/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/ExternalGroupPrincipalProviderTest.java @@ -90,13 +90,13 @@ void sync(@NotNull ExternalUser externalUser) throws Exception { @NotNull Set getExpectedGroupPrincipals(@NotNull String userId) throws Exception { if (syncConfig.user().getMembershipNestingDepth() == 1) { - return CollectionUtils.toSet(idp.getUser(userId).getDeclaredGroups()).stream().map(externalIdentityRef -> { + return CollectionUtils.toStream(idp.getUser(userId).getDeclaredGroups()).map(externalIdentityRef -> { try { return new PrincipalImpl(idp.getIdentity(externalIdentityRef).getPrincipalName()); } catch (ExternalIdentityException e) { throw new RuntimeException(e); } - }).collect(Collectors.toUnmodifiableSet()); + }).collect(Collectors.toSet()); } else { Set set = new HashSet<>(); collectExpectedPrincipals(set, idp.getUser(userId).getDeclaredGroups(), syncConfig.user().getMembershipNestingDepth());