for (Unit subUnit : this.getSubUnits()) {
for (Unit subUnit : unit.getSubUnits()) {
    private void readAndSaveActiveSubUnits(Unit unit, Set<Unit> allActiveSubUnits, Date currentDate) {        if (unit.isActive(currentDate)) {            allActiveSubUnits.add(unit);        }        for (Unit subUnit : this.getSubUnits()) {            readAndSaveActiveSubUnits(subUnit, allActiveSubUnits, currentDate);        }     }