private function addRange(Range $range)
 {
     $ranges = $this->ranges;
     foreach ($ranges as $band) {
         if ($range->overlaps($band)) {
             throw new \OutOfBoundsException("Ranges cannot overlap, ({$band}) ({$range})");
         }
     }
     $ranges[] = $range;
     @usort($ranges, array($this, 'sort'));
     $this->ranges = $ranges;
 }
 function it_can_tell_me_if_it_overlaps_another_range($start, Range $range)
 {
     $range->in($start)->willReturn(true);
     $this->overlap($range)->shouldReturn(true);
 }
 public function startsBefore(Range $range)
 {
     return Comparable::LESS_THAN == $this->compare($range->getStart());
 }