@Override
public Enumeration getGroupNames(String username) throws NoSuchUserException {
try {
Set<String> groupsSet = Collections.EMPTY_SET;
groupsSet = new PAM(PAM_SERVICE).getGroupsOfUser(username);
return Collections.enumeration(groupsSet);
} catch (PAMException ex) {
Logger.getLogger(PamRealm.class.getName()).log(Level.SEVERE,
"pam_exception_getgroupsofuser", ex);
return null;