Span implements Comparable<Span> { public boolean contains(Span s) { return start <= s.getStart() && s.getEnd() <= end; } Span(int s, int e, String type);  Span(int s, int e);  Span(Span span, int offset); int getStart(); int getEnd(); String getType(); int length(); boolean contains(Span s); boolean contains(int index); boolean startsWith(Span s); boolean intersects(Span s); boolean crosses(Span s); CharSequence getCoveredText(CharSequence text); int compareTo(Span s); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); static String[] spansToStrings(Span[] spans, CharSequence s); static String[] spansToStrings(Span[] spans, String[] tokens);  }
@Test public void testContains() { Span a = new Span(500, 900); Span b = new Span(520, 600); assertEquals(true, a.contains(b)); }
@Test public void testContainsWithEqual() { Span a = new Span(500, 900); assertEquals(true, a.contains(a)); }
@Test public void testContainsWithLowerIntersect() { Span a = new Span(500, 900); Span b = new Span(450, 1000); assertEquals(false, a.contains(b)); }
@Test public void testContainsWithHigherIntersect() { Span a = new Span(500, 900); Span b = new Span(500, 1000); assertEquals(false, a.contains(b)); }
@Test public void testContainsInt() { Span a = new Span(10, 300); assertFalse(a.contains(9)); assertTrue(a.contains(10)); assertTrue(a.contains(200)); assertTrue(a.contains(299)); assertFalse(a.contains(300)); }