Check If Two Ranges Overlap Java