code: public static void runExample(
        AdManagerServices adManagerServices, AdManagerSession session, long userId)
        throws RemoteException {
      UserTeamAssociationServiceInterface userTeamAssociationService =
          adManagerServices.get(session, UserTeamAssociationServiceInterface.class);
  
      // Create a statement to select user team associations.
      StatementBuilder statementBuilder =
          new StatementBuilder()
              .where("userId = :userId")
              .orderBy("userId ASC, teamId ASC")
              .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
              .withBindVariableValue("userId", userId);
  
      // Retrieve a small amount of user team associations at a time, paging through
      // until all user team associations have been retrieved.
      int totalResultSetSize = 0;
      do {
        UserTeamAssociationPage page =
            userTeamAssociationService.getUserTeamAssociationsByStatement(
                statementBuilder.toStatement());
  
        if (page.getResults() != null) {
          // Print out some information for each user team association.
          totalResultSetSize = page.getTotalResultSetSize();
          int i = page.getStartIndex();
          for (UserTeamAssociation userTeamAssociation : page.getResults()) {
            System.out.printf(
                "%d) User team association with user ID %d and team ID %d was found.%n",
                i++, userTeamAssociation.getUserId(), userTeamAssociation.getTeamId());
          }
        }
  
        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 userId the user ID.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.