@Override public Segment intersect(long from,long to){
  long start=Math.max(from,this.segmentStart);
  long end=Math.min(to,this.segmentEnd);
  if (start <= end) {
    return new SegmentRange(start,end);
  }
 else {
    return null;
  }
}

@ Override public Segment intersect ( long from , long to ) { long start = Math . max ( from , this . segmentStart ) ; long end = Math . min ( to , this . segmentEnd ) ; if ( start <= end ) { return new SegmentRange ( start , end ) ; } else { return null ; } }
returns a segment that is the intersection of this segment and the interval .
