class DateUtil {

    public static boolean isBetweenHours(int hour, int startHour, int endHour) {
        if (startHour == endHour) {
            return true;
        } else {
            boolean afterStartHour = crossesMidnight(startHour, endHour)
                    ? ((hour >= startHour) || (hour >= MIDNIGHT_HOUR))
                    : (hour >= startHour);
            boolean beforeEndHour = hour < endHour || endHour == MIDNIGHT_HOUR;
            return afterStartHour && beforeEndHour;
        }
    }

}