// Default for total result set size.
int totalResultSetSize = 0;
do {
// Get creative sets by statement.
CreativeSetPage page =
creativeSetService.getCreativeSetsByStatement(statementBuilder.toStatement());
if (page.getResults() != null) {
totalResultSetSize = page.getTotalResultSetSize();
int i = page.getStartIndex();
for (CreativeSet creativeSet : page.getResults()) {
System.out.printf(
"%d) Creative set with ID \"%d\" and name \"%s\" was found.\n", i++,
creativeSet.getId(), creativeSet.getName());
}
}