ContinuousSpaceSegment implements Comparable<ContinuousSpaceSegment<C, V>> { public boolean contains(RangeBoundary<C> point) { return segmentStart.compareTo(point) < 0 && segmentEnd.compareTo(point) > 0; } ContinuousSpaceSegment(C from, C to, V value);  ContinuousSpaceSegment(RangeBoundary<C> from, RangeBoundary<C> to, V value);  ContinuousSpaceSegment(ContinuousSpaceSegment<C, V> other, V value); boolean contains(RangeBoundary<C> point); boolean contains(C point); RangeBoundary<C> segmentStart(); RangeBoundary<C> segmentEnd(); V value(); @Override int compareTo(ContinuousSpaceSegment<C, V> other); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void shouldReturnTrueIfSegmentContainsPoint() { ContinuousSpaceSegment<Integer, String> segment = new ContinuousSpaceSegment<Integer, String>(1, 10, "A"); boolean contains = segment.contains(5); assertThat(contains).isTrue(); }
@Test public void shouldReturnFalseIfSegmentDoesNotContainPoint() { ContinuousSpaceSegment<Integer, String> segment = new ContinuousSpaceSegment<Integer, String>(1, 10, "A"); boolean contains = segment.contains(20); assertThat(contains).isFalse(); }