code: public static void runExample(
        AdManagerServices adManagerServices, AdManagerSession session, long productPackageItemId)
        throws RemoteException {
      // Get the ProductPackageItemService.
      ProductPackageItemServiceInterface productPackageItemService =
          adManagerServices.get(session, ProductPackageItemServiceInterface.class);
  
      // Create a statement to select a single product package item.
      StatementBuilder statementBuilder =
          new StatementBuilder()
              .where("id = :id")
              .orderBy("id ASC")
              .limit(1)
              .withBindVariableValue("id", productPackageItemId);
  
      // Get the product package item.
      ProductPackageItemPage page =
          productPackageItemService.getProductPackageItemsByStatement(statementBuilder.toStatement());
  
      ProductPackageItem productPackageItem =
          Iterables.getOnlyElement(Arrays.asList(page.getResults()));
  
      // Make the product package item mandatory if it isn't already.
      if (!productPackageItem.getIsMandatory()) {
        productPackageItem.setIsMandatory(true);
  
        // Update the product package item on the server.
        ProductPackageItem[] productPackageItems =
            productPackageItemService.updateProductPackageItems(
                new ProductPackageItem[] {productPackageItem});
  
        for (ProductPackageItem updatedProductPackageItem : productPackageItems) {
          System.out.printf(
              "Product package item with ID %d was updated.%n", updatedProductPackageItem.getId());
        }
      } else {
        System.out.println("No product package items were updated.");
      }
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @param productPackageItemId the ID of the product package item to update.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.