Find if hours ranges overlap regardless of the date
问题 I have a set of two hours ranges 10 PM - 02 AM 01 AM - 08 AM I want to check if any of them over lap regardless of the the date. For Example: The first range could be on 1st and 2nd of Aug while the second range could be 10th of Aug. This is what I have so far private Interval createInterval(final OpeningClosingTimesEntry entry) { LocalDateTime openingHour = LocalDateTime.fromDateFields(entry.getOpenTime()); LocalDateTime closingHour = LocalDateTime.fromDateFields(entry.getCloseTime()); if