@Test(dependsOnMethods = "testAddUsersMembers")
public void testUserGetGroupPrincipals() {

    metadata.read(() -> {
        User user1 = this.provider.findUserBySystemName("user1").get();
        User user2 = this.provider.findUserBySystemName("user2").get();
        User user3 = this.provider.findUserBySystemName("user3").get();
        assertThat(user1.getAllGroupPrincipals()).hasSize(1).contains(new GroupPrincipal("groupA"));
        assertThat(user2.getAllGroupPrincipals()).hasSize(2).contains(new GroupPrincipal("groupA"), new GroupPrincipal("groupB"));
        assertThat(user3.getAllGroupPrincipals()).hasSize(3).contains(new GroupPrincipal("groupA"), new GroupPrincipal("groupC"), new GroupPrincipal("groupD"));
    });
}