added support to return a list of group memberships

nitpick: You've used final for some variables but not others. Please be consistent :)