if (isTruck)
if (isTruck) {
  protected void expandAggregates (Task task, Vector subtasks) {    AggregateAsset directObject = (AggregateAsset) task.getDirectObject();    GLMAsset itemProto = (GLMAsset) directObject.getAsset();    ForUnitPG unitPG = getForUnitPG(directObject);    boolean isTruck     = isVehicle(itemProto);    boolean isContainer = isContainer(itemProto);    double itemContrib;    if (isTruck)       itemContrib = getItemAreaContribution(itemProto);    else if (isContainer)       itemContrib = 1;    else      itemContrib = getItemVolumeContribution(itemProto);    double maxCap =       ((isTruck) ? maxAreaCapacity :        (isContainer ? maxContainerCapacity : maxVolumeCapacity)) - CAP_FUDGE;    // double maxCap = (isPerson) ? maxPassengerCapacity : maxContainCapacity - CAP_FUDGE; // fudge necessary?    String unit = (isTruck) ? "m^2" : (isContainer ? "container" : "m^3");    // round item weight to same precision as Vishnu    BigDecimal bigD = new BigDecimal (itemContrib);    itemContrib = bigD.setScale (2,BigDecimal.ROUND_UP).doubleValue();    int remainingQuantity = getAssetQuantity(directObject);    double totalAggregateContrib = ((double)remainingQuantity)*itemContrib;	      boolean mustExpand = (totalAggregateContrib > maxCap);	      if (isDebugEnabled()) {      debug (".expandAggregates - item contribution " + 	    itemContrib + 	    " quantity " + remainingQuantity + 	    " total " + totalAggregateContrib +	    " maxCapacity " + maxCap +	    ((mustExpand) ? " must expand " : ""));    }    int numItemsOnTruck = (int) (maxCap/itemContrib);    // sanity checking     if (numItemsOnTruck == 0) {      warn (".expandAggregates - WARNING - max items on truck " 	    + numItemsOnTruck +	    " is ZERO.  Base asset of aggregate : " + itemProto + 	    " is " + itemContrib + " " + unit + ", which is larger than" + 	    " carrier asset's max capacity " + maxCap + " " + unit);      numItemsOnTruck = 1;    }    if (remainingQuantity == 0)      error (".expandAggregates - ERROR - aggregate asset quantity is zero for direct object " +	     directObject + " of task " + task.getUID());    double maxOnTruck = ((double)numItemsOnTruck)*itemContrib;    if (isDebugEnabled())      debug (".expandAggregates - max items on truck " 	    + numItemsOnTruck +	    " max num " + maxOnTruck);	    // keep making subtasks    while (totalAggregateContrib > maxCap) {        Task newtask;      Asset truckSizedSet = ldmf.createAggregate (itemProto, 						  numItemsOnTruck);      setItemPG (truckSizedSet, itemProto);      subtasks.add (newtask = makeTask (task, truckSizedSet, unitPG));      totalAggregateContrib -= maxOnTruck;      remainingQuantity     -= numItemsOnTruck;      if (isDebugEnabled())	debug(".expandAggregates - cargo > truckload, " +	     "Expanding with " + 	     numItemsOnTruck + 	     " items on carrier, task id " + 	     newtask.getUID() + 	     " remaining quantity " + 	     remainingQuantity + 	     ", contribution " + totalAggregateContrib);    }    // if there's any left over, make one last task    if (remainingQuantity > 0) {      Asset truckSizedSet = 	(mustExpand) ? 	ldmf.createAggregate (itemProto, remainingQuantity) : 	task.getDirectObject();      setItemPG (truckSizedSet, itemProto);      if (isDebugEnabled() && mustExpand)	debug(".expandAggregates - cargo was > truckload, " + 	     remainingQuantity + 	     " items on carrier, truckSizedSet had " +	     ((AggregateAsset)truckSizedSet).getQuantity () 	     + " items");      subtasks.add (makeTask (task, truckSizedSet, unitPG));    }  }