@Test
    public void testIndexEntries() throws IOException {
        int numMessages = 30;
        ElasticLogSegment seg = createOrLoadSegment(40, 2 * records(0, "hello").sizeInBytes() - 1, Time.SYSTEM);
        var offset = 40;
        for (int i = 0; i < numMessages; i++) {
            seg.append(offset, offset, offset, records(offset, "hello"));
            offset += 1;
        }
        assertEquals(offset, seg.readNextOffset());

        int expectedNumEntries = numMessages / 2 - 1;
        assertEquals(expectedNumEntries, seg.timeIndex().entries(), "Should have " + expectedNumEntries + " time indexes");
    }
This test was intended to test truncation and rolling in LogSegment. However, truncation is not supported in
ElasticLogSegment. Therefore, we cut this test down to just verify the rolling and leave the test name as is.
core/src/test/java/kafka/log/streamaspect/ElasticLogSegmentTest.java