//同時創建一個組與account相同,並將此account加到此組中
Group group = new Group(acc.getAccount());
accMgr.createGroup(group);
//
UserGroup userGroup = new UserGroup(acc, group);
Collection<UserGroup> inGroups = new ArrayList<UserGroup>();
inGroups.add(userGroup);
//注:創建一個UserAccount,會同時創建UserProfile和UserGroup
acc.setInGroups(inGroups);
accMgr.createUserAccount(acc);