int totalResultSetSize = 0;
statementBuilder.offset(0);
do {
// Get custom targeting values by statement.
CustomTargetingValuePage page =
customTargetingService.getCustomTargetingValuesByStatement(
statementBuilder.toStatement());
if (page.getResults() != null) {
totalResultSetSize = page.getTotalResultSetSize();
for (CustomTargetingValue customTargetingValue : page.getResults()) {
System.out.printf("%d) Custom targeting value with ID \"%d\", belonging to key "
+ "with ID \"%d\", name \"%s\" and display name \"%s\" was found.\n",
totalResultsCounter++,
customTargetingValue.getId(),
customTargetingValue.getCustomTargetingKeyId(),