class TimelineUtilities {

    static List<DateDurationKey> createDayDateEntries(TimeSpan span, Map<Duration, List<DateDurationKey>> toChange)
    {
        Calendar startTimeCal = getStartCalendar(span);
        Calendar endTimeCal = getEndCalendar(span);

        int totalDaysInDateDurationKey = countDays(startTimeCal, endTimeCal);

        GregorianCalendar nextStart = new GregorianCalendar();
        nextStart.setTime(startTimeCal.getTime());
        List<DateDurationKey> dayDates = new ArrayList<>();
        while (totalDaysInDateDurationKey > 0)
        {
            GregorianCalendar currentStart = new GregorianCalendar();
            currentStart.setTime(nextStart.getTime());
            nextStart.add(Calendar.DATE, 1);

            dayDates.add(new DateDurationKey(currentStart.getTime(), nextStart.getTime(), Days.ONE));

            totalDaysInDateDurationKey--;
        }
        List<DateDurationKey> days = toChange.get(Days.ONE);
        if (days == null)
        {
            toChange.put(Days.ONE, dayDates);
        }
        else
        {
            days.addAll(dayDates);
        }
        return dayDates;
    }

    private  TimelineUtilities();

}