Iterator touchedIter = touchedInventories.iterator(); while (touchedIter.hasNext()) { Inventory inv = (Inventory) touchedIter.next(); LogisticsInventoryPG thePG = (LogisticsInventoryPG)inv. searchForPropertyGroup(LogisticsInventoryPG.class); if (thePG.getIsLevel2()) { level2Inv = inv; } else { level6Inventories.add(inv); } }
  public void calculateRefillProjections(Collection touchedInventories, int daysOnHand,                                         long endOfLevelSix, long endOfLevelTwo, 					 RefillComparator theComparator) {    // get the demand projections for each customer from bg    // time shift the demand for each customer    // sum the each customer's time shifted demand    ArrayList level6Inventories = new ArrayList();    Inventory level2Inv = null;    Iterator touchedIter = touchedInventories.iterator();    while (touchedIter.hasNext()) {      Inventory inv = (Inventory) touchedIter.next();      LogisticsInventoryPG thePG = (LogisticsInventoryPG)inv.        searchForPropertyGroup(LogisticsInventoryPG.class);      if (thePG.getIsLevel2()) {        level2Inv = inv;      } else {        level6Inventories.add(inv);      }    }    if (! level6Inventories.isEmpty()) {      calculateLevelSixProjections(level6Inventories, daysOnHand,                                   endOfLevelSix, theComparator);    }    // if the level 2 and level 6 boundaries are = don't process    // and just for safety make sure the end of level 2 doesn't fall before    // the end of the level 6 window    if ((level2Inv != null) && ( endOfLevelTwo > endOfLevelSix)) {      calculateLevelTwoProjections(level2Inv, daysOnHand,                                    getTimeUtils().addNDays(endOfLevelSix, 1),                                   endOfLevelTwo, theComparator);    }  }