// Default for total result set size.
int totalResultSetSize = 0;
do {
// Get suggested ad units by statement.
SuggestedAdUnitPage page =
suggestedAdUnitService.getSuggestedAdUnitsByStatement(statementBuilder.toStatement());
if (page.getResults() != null) {
totalResultSetSize = page.getTotalResultSetSize();
int i = page.getStartIndex();
for (SuggestedAdUnit suggestedAdUnit : page.getResults()) {
System.out.printf("%d) Suggested ad unit with ID \"%s\", path \"%s\", "
+ "and number of requests \"%d\" was found.\n",
i++, suggestedAdUnit.getId(), Joiner.on('/').join(suggestedAdUnit.getPath()),
suggestedAdUnit.getNumRequests());
}