public int createCargo (String name, int amount, int specialInstrument)
            throws ObjectNotFoundException, ObjectAlreadyExistsException,
            InvalidInstrumentTypeException, ExhaustedCargoCellsException, IllegalNumberException {
        int cells[] = new int[0];
        int free;
        Cargo cargo;
        Object instrument = this.get(specialInstrument);

        if (amount < 0) {
            throw new IllegalNumberException();
        }

        if (!(instrument instanceof CargoRocket) && !(instrument instanceof ExplorationRobot)) {
            throw new InvalidInstrumentTypeException("Cargo should be for CargoRocket or ExplorationRobot only.");
        }

        if (instrument instanceof CargoRocket) {
            cells = ((CargoRocket) instrument).getCargo();
        }

        if (instrument instanceof ExplorationRobot) {
            cells = ((ExplorationRobot) instrument).getCargo();
        }

        free = this.getNextFreeCargoCellPosition(cells);

        if (free == -1) {
            throw new ExhaustedCargoCellsException();
        }

        cargo = new Cargo(this.getNextUniversalId(), amount, specialInstrument, name);

        program.add(cargo);

        cells[free] = cargo.getId();

        if (instrument instanceof CargoRocket) {
            ((CargoRocket) instrument).setCargo(cells);
        }

        if (instrument instanceof ExplorationRobot) {
            ((ExplorationRobot) instrument).setCargo(cells);
        }

        return cargo.getId();
    }