code: public static void runExample(
        AdManagerServices adManagerServices, AdManagerSession session, long numRequests)
        throws RemoteException {
      SuggestedAdUnitServiceInterface suggestedAdUnitService =
          adManagerServices.get(session, SuggestedAdUnitServiceInterface.class);
  
      // Create a statement to select suggested ad units.
      StatementBuilder statementBuilder = new StatementBuilder()
          .where("numRequests >= :numRequests")
          .orderBy("id ASC")
          .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
          .withBindVariableValue("numRequests", numRequests);
  
      // Retrieve a small amount of suggested ad units at a time, paging through
      // until all suggested ad units have been retrieved.
      int totalResultSetSize = 0;
      do {
        SuggestedAdUnitPage page =
            suggestedAdUnitService.getSuggestedAdUnitsByStatement(statementBuilder.toStatement());
  
        if (page.getResults() != null) {
          // Print out some information for each suggested ad unit.
          totalResultSetSize = page.getTotalResultSetSize();
          int i = page.getStartIndex();
          for (SuggestedAdUnit suggestedAdUnit : page.getResults()) {
            System.out.printf(
                "%d) Suggested ad unit with ID '%s' and num requests %d was found.%n",
                i++,
                suggestedAdUnit.getId(),
                suggestedAdUnit.getNumRequests()
            );
          }
        }
  
        statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
      } while (statementBuilder.getOffset() < totalResultSetSize);
  
      System.out.printf("Number of results found: %d%n", totalResultSetSize);
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @param numRequests the number of requests.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.