code: public static void runExample(
        AdWordsServicesInterface adWordsServices, AdWordsSession session, Long adGroupId)
        throws RemoteException {
      // Get the AdGroupCriterionService.
      AdGroupCriterionServiceInterface adGroupCriterionService =
          adWordsServices.get(session, AdGroupCriterionServiceInterface.class);
  
      int offset = 0;
      boolean morePages = true;
  
      // Create selector.
      SelectorBuilder builder = new SelectorBuilder();
      Selector selector = builder
          .fields(
              AdGroupCriterionField.Id,
              AdGroupCriterionField.CriteriaType,
              AdGroupCriterionField.KeywordMatchType,
              AdGroupCriterionField.KeywordText)
          .orderAscBy(AdGroupCriterionField.KeywordText)
          .offset(offset)
          .limit(PAGE_SIZE)
          .in(AdGroupCriterionField.AdGroupId, adGroupId.toString())
          .in(AdGroupCriterionField.CriteriaType, "KEYWORD")
          .build();
  
      while (morePages) {
        // Get all ad group criteria.
        AdGroupCriterionPage page = adGroupCriterionService.get(selector);
  
        // Display ad group criteria.
        if (page.getEntries() != null && page.getEntries().length > 0) {
          // Display results.
          Arrays.stream(page.getEntries())
              .map(adGroupCriterionResult -> (Keyword) adGroupCriterionResult.getCriterion())
              .forEach(
                  keyword ->
                      System.out.printf(
                          "Keyword with text '%s', match type '%s', criteria type '%s',"
                              + " and ID %d was found.%n",
                          keyword.getText(),
                          keyword.getMatchType(),
                          keyword.getType(),
                          keyword.getId()));
        } else {
          System.out.println("No ad group criteria were found.");
        }
  
        offset += PAGE_SIZE;
        selector = builder.increaseOffsetBy(PAGE_SIZE).build();
        morePages = offset < page.getTotalNumEntries();
      }
    }
docs: Runs the example.
  
  @param adWordsServices the services factory.
  @param session the session.
  @param adGroupId the ID of the ad group to use to find keywords.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.