poissonQty));
taskQty));
  public void generateDemandTasks(long start, long duration, Collection relevantProjectSupplys) {    regenerateProjectionHash(relevantProjectSupplys);    long end = start + duration;    Iterator gpTasksIt = projHash.keySet().iterator();    while (gpTasksIt.hasNext()) {      Task gpTask = (Task) gpTasksIt.next();      ArrayList supplyTasks = new ArrayList();      HashMap assetMap = (HashMap) projHash.get(gpTask);      Iterator assetsIt = assetMap.keySet().iterator();      while (assetsIt.hasNext()) {        Asset consumed = (Asset) assetsIt.next();        Collection projTasks = (Collection) (assetMap.get(consumed));        double totalQty = deriveTotalQty(start,end,projTasks);        int poissonQty = poissonGen.nextPoisson(totalQty);        Iterator projTaskIt = projTasks.iterator();        //This should not be a while, but an if        if((poissonQty > 0) &&           (projTaskIt.hasNext())) {            supplyTasks.add(createNewDemandTask(gpTask,                                                  (Task) projTaskIt.next(),                                                  consumed,                                                  start,                                                  end,                                                  poissonQty));        }      }      if(!supplyTasks.isEmpty()){        addToAndPublishExpansion(gpTask,supplyTasks);      }    }  }