Range intersection is a simple, but non-trivial problem.
Its has been answered twice already:
Non Overlapping Ranges:
Prep O(n log n):
Search:
Iterator starting at the binary search until you find an Start > TestRange.End:
2a. If the range if the current range is within the TestRange, add it to your result.