Integer departmentID = null, degreeID = null;  if (this.getDepartmentID() != null && !this.getDepartmentID().equals("#")) { departmentID = Integer.valueOf(this.getDepartmentID()); } if (this.getDegreeID() != null && !this.getDegreeID().equals("#")) { degreeID = Integer.valueOf(this.getDegreeID()); }
CreateNewUnitParameters parameters = new CreateNewUnitParameters(departmentID, degreeID, this, 1);
    public String createTopUnit() throws FenixFilterException, FenixServiceException {        if (verifyCostCenterCode()) {            return "";        }        PrepareDatesResult datesResult = prepareDates(this.getUnitBeginDate(), this.getUnitEndDate());        if (datesResult.isTest()) {            return "";        }        UnitType type = getUnitType();        Integer departmentID = null, degreeID = null;        if (this.getDepartmentID() != null && !this.getDepartmentID().equals("#")) {            departmentID = Integer.valueOf(this.getDepartmentID());        }        if (this.getDegreeID() != null && !this.getDegreeID().equals("#")) {            degreeID = Integer.valueOf(this.getDegreeID());        }        final Object[] argsToRead = { null, null, this.getUnitName(), this.getUnitCostCenter(),                datesResult.getBeginDate(), datesResult.getEndDate(), type, departmentID, degreeID };        try {            ServiceUtils.executeService(getUserView(), "CreateNewUnit", argsToRead);        } catch (FenixServiceException e) {            setErrorMessage(e.getMessage());            return "";        }        return "listAllUnits";    }