} else if (course.getBeginDate().getTimeInMillis() < beginDate.getTimeInMillis()) {
} else if (course.getBeginDate().get(Calendar.HOUR_OF_DAY) * 60 + course.getBeginDate().get(Calendar.MINUTE) < beginDate.get(Calendar.HOUR_OF_DAY) * 60 + beginDate.get(Calendar.MINUTE)) {
    public void addCourse(Course course) {        courses.add(course);        if (courses.size() == 1) {            beginDate.setTime(course.getBeginDate().getTime());            endDate.setTime(course.getEndDate().getTime());        } else if (course.getBeginDate().getTimeInMillis() < beginDate.getTimeInMillis()) {            beginDate.setTime(course.getBeginDate().getTime());        } else if (course.getEndDate().getTimeInMillis() > endDate.getTimeInMillis()) {            endDate.setTime(course.getEndDate().getTime());        }        if (course.getSubject() != null) {	        Color color = course.getSubject().getColor();	        red += color.getRed();	        green += color.getGreen();	        blue += color.getBlue();        }    }