CargoBatch cb = (CargoBatch)it.next();
Entry entry = (Entry) it.next(); CargoBatch cb = (CargoBatch)entry.getKey();
    public void update(World w) {	NonNullElements players = new NonNullElements(KEY.PLAYERS, w,		Player.AUTHORITATIVE);	while (players.next()) {	    FreerailsPrincipal p = (FreerailsPrincipal) ((Player)		    players.getElement()).getPrincipal();	    NonNullElements nonNullStations = new		NonNullElements(KEY.STATIONS, w, p);	    while (nonNullStations.next()) {		StationModel station =		    (StationModel)nonNullStations.getElement();		SupplyAtStation supply = station.getSupply();		CargoBundle cargoBundle = (CargoBundle)w.get(KEY.CARGO_BUNDLES,			station.getCargoBundleNumber());		CargoBundle before = cargoBundle.getCopy();		CargoBundle after = cargoBundle.getCopy();		int stationNumber = nonNullStations.getIndex();		/* Let the cargo have a half life of one year, so half the		 * existing cargo wastes away.*/		Iterator it = after.cargoBatchIterator();		while (it.hasNext()) {		    CargoBatch cb = (CargoBatch)it.next();		    int amount = after.getAmount(cb);		    if (amount > 0) {			after.setAmount(cb, (int) ((1.0 - Math.pow(0.5, 1.0 /					    12)) * amount));		    }		}		for (int i = 0; i < w.size(KEY.CARGO_TYPES); i++) {		    int amountSupplied = supply.getSupply(i);		    CargoType cargoType = (CargoType) w.get(KEY.CARGO_TYPES, i);		    if (amountSupplied > 0) {			CargoBatch cb = new CargoBatch(i, station.x,				station.y, 0, stationNumber);			int amountAlready = after.getAmount(cb);			after.setAmount(cb, (amountSupplied / 12) + amountAlready);		    }		}		Move m = new ChangeCargoBundleMove(before, after,			station.getCargoBundleNumber());		moveReceiver.processMove(m);	    }        }    }