public static < T extends Comparable < T > > RangeSet < T > intersectRangeSets ( final Iterable < RangeSet < T > > rangeSets ) { RangeSet < T > rangeSet = null ; for ( final RangeSet < T > set : rangeSets ) { if ( rangeSet == null ) { rangeSet = TreeRangeSet . create ( ) ; rangeSet . addAll ( set ) ; } else { rangeSet . removeAll ( set . complement ( ) ) ; } } return rangeSet ; }
Intersects a set of rangeSets or returns null if the set is empty .