NSRange intersection = range.rangeByIntersectingRange(otherRange); //3,4
assertEquals(new NSRange(3, 2), intersection);
}
public void testRangeByUnioningRange() {
NSRange range = new NSRange(2,3); //2,3,4
NSRange otherRange = new NSRange(3, 3); //3,4,5
NSRange union = range.rangeByUnioningRange(otherRange); //2,3,4,5
assertEquals(new NSRange(2, 4), union);
}