int totalCredits = 0;
double totalCredits = 0.0;
    public int getManagementFunctionsCredits(IExecutionPeriod executionPeriod) {        // TODO por isto a devolver um double!        Date begin = executionPeriod.getBeginDate();        Date end = executionPeriod.getEndDate();        List<IPersonFunction> list = new ArrayList<IPersonFunction>();        for (IPersonFunction personFunction : this.getPerson().getPersonFunctions()) {            if (personFunction.belongsToPeriod(begin, end)) {                list.add(personFunction);            }        }        int totalCredits = 0;        if (list.size() > 1) {            for (IPersonFunction function : list) {                totalCredits = (function.getCredits() != null) ? totalCredits                        + function.getCredits().intValue() : totalCredits;            }            return totalCredits;        } else if (list.size() == 1) {            Double credits = list.iterator().next().getCredits();            if (credits != null) {                return credits.intValue();            }        }        return 0;    }