Range implements Comparable<Range> { public boolean isWithin( Position p) { return m_start.compareTo(p) <= 0 && m_end.compareTo(p) >= 0; } Range(/*@ non_null @*/ Position start, /*@ non_null @*/ Position end, int length);  Range(Position start, Position end); Position getStart(); Position getEnd(); int getLength(); @Override /*@ pure non_null @*/ String toString(); boolean isWithin(/*@ non_null @*/ Position p); @Override int compareTo(/*@ nullable @*/ Range r); Range intersectWith(/*@ non_null @*/ Range r); Range setZero(/*@ non_null @*/ Position zero); @Override /*@ pure @*/ int hashCode(); @Override /*@ pure @*/ boolean equals(Object o); boolean isMultiLine(); static Range make(int start_l, int start_c, int end_l, int end_c); static Range make(int line, int start_c, int end_c);  }
@Test public void testWithin1() { Range r1 = new Range(new Position(0, 0), new Position(0, 5)); assertTrue(r1.isWithin(new Position(0, 4))); }
@Test public void testWithin2() { Range r1 = new Range(new Position(0, 0), new Position(0, 5)); assertFalse(r1.isWithin(new Position(0, 8))); }