@Test
  public void inSpanTest() {
    LogSegmentName firstLogSegmentName = LogSegmentName.generateFirstSegmentName(true);
    LogSegmentName startLogSegmentName = firstLogSegmentName.getNextPositionName();
    LogSegmentName interveningLogSegmentName = startLogSegmentName.getNextPositionName();
    LogSegmentName endLogSegmentName = interveningLogSegmentName.getNextPositionName();
    long startOffsetInStartLogSegment = 100;
    long endOffsetInEndLogSegment = 100;
    FileSpan span = new FileSpan(new Offset(startLogSegmentName, startOffsetInStartLogSegment),
        new Offset(endLogSegmentName, endOffsetInEndLogSegment));
    long testOffsetStart = 0;
    long testOffsetEnd = 200;

    for (LogSegmentName segmentName : new LogSegmentName[]{firstLogSegmentName, startLogSegmentName, interveningLogSegmentName, endLogSegmentName}) {
      for (long offsetInSegment = testOffsetStart; offsetInSegment <= testOffsetEnd; offsetInSegment++) {
        Offset offset = new Offset(segmentName, offsetInSegment);
        boolean inSpan = segmentName.equals(interveningLogSegmentName) || (segmentName.equals(startLogSegmentName)
            && offsetInSegment >= startOffsetInStartLogSegment) || (segmentName.equals(endLogSegmentName)
            && offsetInSegment < endOffsetInEndLogSegment);
        assertEquals("inSpan() result not as expected", inSpan, span.inSpan(offset));
      }
    }
  }
Tests for {@link FileSpan#inSpan(Offset)}.
ambry-store/src/test/java/com/github/ambry/store/FileSpanTest.java