ActivityGroupServiceInterface activityGroupService =
user.getService(DfpService.V201308.ACTIVITY_GROUP_SERVICE);
// Set defaults for page and filterStatement.
ActivityGroupPage page = new ActivityGroupPage();
Statement filterStatement = new Statement();
int offset = 0;
do {
// Create a statement to get all activity groups.
filterStatement.setQuery("LIMIT 500 OFFSET " + offset);
// Get activity groups by statement.
page = activityGroupService.getActivityGroupsByStatement(filterStatement);
if (page.getResults() != null) {