Who to check if From Hour and To Hour are overlapped in java : I have a requirement where i can create 3 shifts per day. The shift timings   are 

1) 06:00 - 14:00   
2) 14:01 - 22:00   
3) 22:01 - 05:59. 

How can i check that shift timings are not overlapped. Your suggestions are appreciated.  Please note that in the third case from hour is greater that to hour.