class TimelineUtilities {

    public static TimeSpan getPrecedingWeeks(Date reference, int numWeeks, boolean includeThisWeek)
    {
        Calendar gc = get0000(reference);

        gc.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
        gc.add(Calendar.WEEK_OF_YEAR, includeThisWeek ? 1 - numWeeks : -numWeeks);
        long start = gc.getTimeInMillis();

        gc.add(Calendar.WEEK_OF_YEAR, numWeeks);
        Date tomorrowQuadZ = getNext0000(reference).getTime();
        if (gc.getTime().after(tomorrowQuadZ))
        {
            gc.setTime(tomorrowQuadZ);
        }
        long end = gc.getTimeInMillis();

        return TimeSpan.get(start, end);
    }

    private  TimelineUtilities();

}