public boolean onSameSegment(LogOffsetMetadata that) {
        if (messageOffsetOnly() || that.messageOffsetOnly())
            return false;
        return this.segmentBaseOffset == that.segmentBaseOffset;
    }
@Test
    void testOnSameSegment() {
        LogOffsetMetadata metadata1 = new LogOffsetMetadata(1L, 0L, 1);
        LogOffsetMetadata metadata2 = new LogOffsetMetadata(5L, 4L, 2);
        LogOffsetMetadata metadata3 = new LogOffsetMetadata(10L, 4L, 200);
        assertFalse(metadata1.onSameSegment(metadata2));
        assertTrue(metadata2.onSameSegment(metadata3));

        LogOffsetMetadata metadata4 = new LogOffsetMetadata(50);
        LogOffsetMetadata metadata5 = new LogOffsetMetadata(100);
        assertFalse(metadata4.onSameSegment(metadata5));
    }