// Get DfpUser from "~/dfp.properties".
DfpUser user = new DfpUser();
// Get the LineItemService.
LineItemServiceInterface lineItemService =
user.getService(DfpService.V201302.LINEITEM_SERVICE);
// Set the ID of the order to get line items from.
Long orderId = Long.parseLong("INSERT_ORDER_ID_HERE");
// Create a statement to only select line items that need creatives from a
// given order.
Statement filterStatement =
new StatementBuilder("WHERE orderId = :orderId AND status = :status LIMIT 500")
.putValue("orderId", orderId)
.putValue("status", ComputedStatus.NEEDS_CREATIVES.toString())
.toStatement();
// Get line items by statement.
LineItemPage page = lineItemService.getLineItemsByStatement(filterStatement);
if (page.getResults() != null) {
int i = page.getStartIndex();
for (LineItem lineItem : page.getResults()) {
System.out.println(i + ") Line item with ID \""