code: public static void runExample(
        AdManagerServices adManagerServices, AdManagerSession session, List<Long> lineItemIds)
        throws RemoteException {
      // Get the ForecastService.
      ForecastServiceInterface forecastService =
          adManagerServices.get(session, ForecastServiceInterface.class);
  
      DeliveryForecastOptions options = new DeliveryForecastOptions();
  
      DeliveryForecast forecast =
          forecastService.getDeliveryForecastByIds(Longs.toArray(lineItemIds), options);
  
      for (LineItemDeliveryForecast lineItemForecast : forecast.getLineItemDeliveryForecasts()) {
        String unitType = lineItemForecast.getUnitType().toString().toLowerCase();
        System.out.printf("Forecast for line item %d:%n", lineItemForecast.getLineItemId());
        System.out.printf("\t%d %s matched%n", lineItemForecast.getMatchedUnits(), unitType);
        System.out.printf("\t%d %s delivered%n", lineItemForecast.getDeliveredUnits(), unitType);
        System.out.printf(
            "\t%d %s predicted%n", lineItemForecast.getPredictedDeliveryUnits(), unitType);
      }
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @param lineItemIds the IDs of the line items to get a forecast for. You may pass multiple
  values.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.