// create a new user for an it-support employee
User itguy = identityService.newUser("itguy");
identityService.saveUser(itguy);
// create a group it-support for critical issues
Group itSupportGroup = identityService.newGroup("itsupport-critical");
itSupportGroup.setName("IT Support for Critical Issues");
identityService.saveGroup(itSupportGroup);
// assign the user itguy to the group itsupport-critical
identityService.createMembership(itguy.getId(), itSupportGroup.getId());