// get the group using the roots groupid
Group gr1 = SetUID.getgrgid(passwd1.getPwGid());
// get the group name using the aquired name
Group gr2 = SetUID.getgrnam(gr1.getGrName());
assertEquals(gr1.getGrName(), gr2.getGrName());
assertEquals(gr1.getGrPasswd(), gr2.getGrPasswd());
assertEquals(gr1.getGrGid(), gr2.getGrGid());
// search and check through membership lists
if(gr1.getGrMem() != null)
{
assertEquals(gr1.getGrMem().length, gr2.getGrMem().length);
for(int i=0; i<gr1.getGrMem().length; i++)
{
assertEquals(gr1.getGrMem()[i], gr2.getGrMem()[i]);
}
}
}