Hello,
just specifying the groupid and
this code
client.getTasksAssignedAsPotentialOwner("actorId", groups, "en-UK", taskSummaryResponseHandler);
is enough.
Make sure that you have added the groups and users to the task session i.e. from https://github.com/calcacuervo/JBPM5-Samples/blob/master/human-tasks/src/test/java/com/test/BaseHumanTaskTest.java
.....
session.addUser(new User(testUser));
session.addGroup(new Group(testGroup));
Also make sure the database table OrganizationalEntity contains them.