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