timeline.plotListInTimeline(workDaySheet.getAssiduousnessRecords(), workDaySheet .getLeaves(), attributesIt, day);
timeline.plotListInTimeline(workDaySheet.getAssiduousnessRecords(), timeLeaves, attributesIt, day);
    public WorkDaySheet calculateDailyBalance(WorkDaySheet workDaySheet, YearMonthDay day,            boolean isDayHoliday) {        if (workDaySheet.getWorkSchedule() != null && !isDayHoliday) {            Timeline timeline = new Timeline(workDaySheet.getWorkSchedule().getWorkScheduleType());            List<Leave> dayOccurrences = getLeavesByType(workDaySheet.getLeaves(),                    JustificationType.OCCURRENCE);            if (dayOccurrences.isEmpty()) {                List<Leave> timeLeaves = getLeavesByType(workDaySheet.getLeaves(),                        JustificationType.TIME);                List<Leave> balanceLeaves = getLeavesByType(workDaySheet.getLeaves(),                        JustificationType.BALANCE);                if (!workDaySheet.getAssiduousnessRecords().isEmpty() || !timeLeaves.isEmpty()) {                    Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES                            .getAttributes().iterator();                    timeline.plotListInTimeline(workDaySheet.getAssiduousnessRecords(), workDaySheet                            .getLeaves(), attributesIt, day);                    workDaySheet = workDaySheet.getWorkSchedule().calculateWorkingPeriods(workDaySheet,                            day, timeline, timeLeaves);                } else {                    workDaySheet.setBalanceTime(Duration.ZERO.minus(                            workDaySheet.getWorkSchedule().getWorkScheduleType().getNormalWorkPeriod()                                    .getWorkPeriodDuration()).toPeriod());                    if (workDaySheet.getWorkSchedule().getWorkScheduleType().getFixedWorkPeriod() != null) {                        workDaySheet.setUnjustifiedTime(workDaySheet.getWorkSchedule()                                .getWorkScheduleType().getFixedWorkPeriod().getWorkPeriodDuration());                    }                    if (balanceLeaves.isEmpty()) {                        workDaySheet.setNotes(workDaySheet.getNotes().concat("FALTA INJ"));                    }                }                workDaySheet.discountBalanceLeaveInFixedPeriod(balanceLeaves);            }        } else {            if (!workDaySheet.getAssiduousnessRecords().isEmpty()) {                final Timeline timeline = new Timeline(day);                Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES.getAttributes()                        .iterator();                timeline.plotListInTimeline(workDaySheet.getAssiduousnessRecords(), workDaySheet                        .getLeaves(), attributesIt, day);                Duration worked = timeline.calculateWorkPeriodDuration(null, timeline.getTimePoints()                        .iterator().next(), new TimePoint(defaultStartWorkDay, AttributeType.NULL),                        new TimePoint(defaultEndWorkDay, AttributeType.NULL), null);                Duration weeklyRestDuration = worked;                if (worked.isLongerThan(normalWorkDayDuration)) {                    weeklyRestDuration = normalWorkDayDuration;                }                final WeekDay dayOfWeek = WeekDay.fromJodaTimeToWeekDay(day.toDateTimeAtMidnight());                if (dayOfWeek.equals(WeekDay.SATURDAY) || isDayHoliday) {                    workDaySheet.setComplementaryWeeklyRest(weeklyRestDuration);                } else if (dayOfWeek.equals(WeekDay.SUNDAY)) {                    workDaySheet.setWeeklyRest(weeklyRestDuration);                }                workDaySheet.setBalanceTime(worked.toPeriod());            }        }        return workDaySheet;    }