@Test public void testSpan() { final MarkerRange unbounded = new MarkerRange(comparator); final MarkerRange unboundedToNov1 = new MarkerRange(comparator).to(NOV_1); final MarkerRange oct12ToOct15 = new MarkerRange(comparator).from(OCT_12).to(OCT_15); final MarkerRange sept30ToOct15 = new MarkerRange(comparator).from(SEPT_30).to(OCT_15); final MarkerRange oct12ToNov1 = new MarkerRange(comparator).from(OCT_12).to(NOV_1); final MarkerRange sept30ToNov1 = new MarkerRange(comparator).from(SEPT_30).to(NOV_1); final MarkerRange sept30ToUnbounded = new MarkerRange(comparator).from(SEPT_30); final MarkerRange nov1ToUnbounded = new MarkerRange(comparator).from(NOV_1); assertEquals(unbounded, unbounded.span(unbounded)); assertEquals(oct12ToOct15, oct12ToOct15.span(oct12ToOct15)); assertEquals(unboundedToNov1, unboundedToNov1.span(unboundedToNov1)); assertEquals(sept30ToUnbounded, sept30ToUnbounded.span(sept30ToUnbounded)); assertEquals(unbounded, unbounded.span(oct12ToOct15)); assertEquals(unbounded, oct12ToOct15.span(unbounded)); assertEquals(unboundedToNov1, unboundedToNov1.span(oct12ToOct15)); assertEquals(sept30ToUnbounded, sept30ToUnbounded.span(oct12ToOct15)); assertEquals(sept30ToUnbounded, nov1ToUnbounded.span(sept30ToUnbounded)); assertEquals(sept30ToUnbounded, sept30ToUnbounded.span(nov1ToUnbounded)); assertEquals(sept30ToNov1, sept30ToNov1.span(oct12ToOct15)); assertEquals(sept30ToNov1, oct12ToOct15.span(sept30ToNov1)); assertEquals(sept30ToNov1, sept30ToOct15.span(oct12ToNov1)); assertEquals(sept30ToNov1, oct12ToNov1.span(sept30ToOct15)); assertEquals(sept30ToUnbounded, sept30ToOct15.span(nov1ToUnbounded)); assertEquals(sept30ToUnbounded, nov1ToUnbounded.span(sept30ToOct15)); }
public MarkerRange span(MarkerRange other) { Boundary newStart = Ordering.from(new Boundary.LeftComparator()).min(start, other.start); Boundary newEnd = Ordering.from(new Boundary.RightComparator()).max(end, other.end); return new MarkerRange(comparator, newStart, newEnd); }
MarkerRange { public MarkerRange span(MarkerRange other) { Boundary newStart = Ordering.from(new Boundary.LeftComparator()).min(start, other.start); Boundary newEnd = Ordering.from(new Boundary.RightComparator()).max(end, other.end); return new MarkerRange(comparator, newStart, newEnd); } }
MarkerRange { public MarkerRange span(MarkerRange other) { Boundary newStart = Ordering.from(new Boundary.LeftComparator()).min(start, other.start); Boundary newEnd = Ordering.from(new Boundary.RightComparator()).max(end, other.end); return new MarkerRange(comparator, newStart, newEnd); } private  MarkerRange();  MarkerRange(MarkerComparator comparator); private  MarkerRange(
      MarkerComparator comparator,
      Boundary start, Boundary end); }
MarkerRange { public MarkerRange span(MarkerRange other) { Boundary newStart = Ordering.from(new Boundary.LeftComparator()).min(start, other.start); Boundary newEnd = Ordering.from(new Boundary.RightComparator()).max(end, other.end); return new MarkerRange(comparator, newStart, newEnd); } private  MarkerRange();  MarkerRange(MarkerComparator comparator); private  MarkerRange(
      MarkerComparator comparator,
      Boundary start, Boundary end); boolean contains(Marker marker); MarkerRange from(Marker start); MarkerRange fromAfter(Marker start); MarkerRange to(Marker end); MarkerRange toBefore(Marker end); MarkerRange of(Marker partial); MarkerRange intersection(MarkerRange other); MarkerRange span(MarkerRange other); MarkerRange complement(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Boundary getStart(); Boundary getEnd(); }
MarkerRange { public MarkerRange span(MarkerRange other) { Boundary newStart = Ordering.from(new Boundary.LeftComparator()).min(start, other.start); Boundary newEnd = Ordering.from(new Boundary.RightComparator()).max(end, other.end); return new MarkerRange(comparator, newStart, newEnd); } private  MarkerRange();  MarkerRange(MarkerComparator comparator); private  MarkerRange(
      MarkerComparator comparator,
      Boundary start, Boundary end); boolean contains(Marker marker); MarkerRange from(Marker start); MarkerRange fromAfter(Marker start); MarkerRange to(Marker end); MarkerRange toBefore(Marker end); MarkerRange of(Marker partial); MarkerRange intersection(MarkerRange other); MarkerRange span(MarkerRange other); MarkerRange complement(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Boundary getStart(); Boundary getEnd();  }