// Get the InventoryService.
InventoryServiceInterface inventoryService =
dfpServices.get(session, InventoryServiceInterface.class);
// Get the NetworkService.
NetworkServiceInterface networkService =
dfpServices.get(session, NetworkServiceInterface.class);
// Set the parent ad unit's ID for all children ad units to be fetched from.
String parentAdUnitId = networkService.getCurrentNetwork().getEffectiveRootAdUnitId();
// Create a statement to select ad units under the parent ad unit.
StatementBuilder statementBuilder = new StatementBuilder()
.where("parentId = :parentId")
.limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)