Make IntervalExtensions.GetEndPoints generic