AggregateResultリストから項目値取得
List<String> testQueueUserIdList = new List<String>();
for(AggregateResult gmObj : [SELECT UserOrGroupId, COUNT( Id )
FROM GroupMember
WHERE GroupId IN ( SELECT Id FROM Group WHERE Type = 'Queue' And DeveloperName = 'testQueue')
GROUP BY UserOrGroupId]){
testQueueUserIdList.add(String.valueOf(gmObj.get('UserOrGroupId')));
}
System.debug('testQueueUserIdList : ' + testQueueUserIdList);