Date currentDate = Calendar.getInstance().getTime();
    private void getUnitsList(IUnit parentUnit, int index, StringBuffer buffer) {        buffer.append("<li>").append("<a href=\"").append(getContextPath()).append(                "/manager/functionsManagement/chooseFunction.faces?personID=").append(personID).append(                "&unitID=").append(parentUnit.getIdInternal()).append("\">")                .append(parentUnit.getName()).append("</a>").append("</li>").append("<ul>");        Date currentDate = Calendar.getInstance().getTime();        for (IUnit subUnit : parentUnit.getSubUnits()) {            if (subUnit.isActive(currentDate)) {                getUnitsList(subUnit, index + 1, buffer);            }        }        buffer.append("</ul>");    }