// Default for total result set size.
int totalResultSetSize = 0;
do {
// Get content by statement.
ContentPage page = contentService.getContentByStatementAndCustomTargetingValue(
statementBuilder.toStatement(), categoryCustomTargetingValueId);
if (page.getResults() != null) {
totalResultSetSize = page.getTotalResultSetSize();
int i = page.getStartIndex();
for (Content content : page.getResults()) {
System.out.printf(
"%d) Content with ID \"%d\" and name \"%s\" was found.\n", i++,
content.getId(), content.getName());
}
}