I want to check whether a user contains a certain public group. I have tried the following select statement
[SELECT id, Name FROM Group where RelatedId=: userInfo.getUserRoleId()
and DeveloperName = *`<public group name>`* Limit 1]
But this does not return any record even though I have assigned the user into the public group.