code: private Collection<Membership> findMembershipsByGroup(Session session, Group group) throws Exception
     {
        Node groupNode;
        NodeIterator refUsers;
        try
        {
           groupNode = utils.getGroupNode(session, group);
           refUsers = groupNode.getNode(JCROrganizationServiceImpl.JOS_MEMBERSHIP).getNodes();
        }
        catch (PathNotFoundException e)
        {
           return new ArrayList<Membership>();
        }
  
        List<Membership> memberships = new ArrayList<Membership>();
        while (refUsers.hasNext())
        {
           Node refUserNode = refUsers.nextNode();
           memberships.addAll(findMembershipsByUserAndGroup(session, refUserNode, groupNode));
        }
  
        return memberships;
     }
docs: Use this method to find all the membership in a group.