// Get the InventoryService.
InventoryServiceInterface inventoryService =
dfpServices.get(session, InventoryServiceInterface.class);
// Get the NetworkService.
NetworkServiceInterface networkService =
dfpServices.get(session, NetworkServiceInterface.class);
// Get the effective root ad unit.
AdUnit effectiveRootAdUnit =
inventoryService.getAdUnit(
networkService.getCurrentNetwork().getEffectiveRootAdUnitId());
// Get all ad units.
List<AdUnit> adUnits = getAllAdUnits(dfpServices, session);
buildAndDisplayAdUnitTree(effectiveRootAdUnit, adUnits);