for (Iterator i = container.iterator(); i.hasNext(); ) { Object o = i.next();
Object o=null; Iterator i=null;   for (i = container.iterator(); i.hasNext(); ) { o = i.next();
  private UIInventoryImpl getInventoryFromLogPlan(Collection container) {    UIInventoryImpl inventory = new UIInventoryImpl();    Allocation lastAllocation=null;    for (Iterator i = container.iterator(); i.hasNext(); ) {      Object o = i.next();      if (o instanceof Asset) {	inventory.setAsset((Asset)o);      }      else if (o instanceof Allocation) {	lastAllocation = (Allocation) o;	inventory.addDueInSchedule((Allocation)o);	inventory.addRequestedDueInSchedule((Allocation)o);      }    }    //MWD new code if there are no ALPAsset Inventories it's likely    //the Asset has not been set on this UIInventoryImpl.    //There are just allocations in this InventoryPredicate returned    //collection and hence if (o instanceof Asset) has been used.    if((lastAllocation != null) &&       (inventory.getAsset() == null)) {	Asset directAsset = lastAllocation.getTask().getDirectObject();	inventory.setAsset(directAsset);	        }    return inventory;  }