CargoBatch cb = (CargoBatch)it.next();
CargoBatch cb = (CargoBatch)((Entry) it.next()).getKey();
    public int getAmount(int cargoType) {        Iterator it = cargoBatchIterator();        int amount = 0;        while (it.hasNext()) {            CargoBatch cb = (CargoBatch)it.next();            if (cb.getCargoType() == cargoType) {                amount += getAmount(cb);            }        }        return amount;    }