void updateSegmentId(int segmentId) {
        NettyPayload segmentNettyPayload = NettyPayload.newSegment(segmentId);
        addFinishedBuffer(segmentNettyPayload);
    }
@Test
    void testUpdateSegmentId() {
        int segmentId = 1;

        MemoryTierSubpartitionProducerAgent subpartitionProducerAgent =
                createSubpartitionProducerAgent();

        AtomicReference<NettyPayload> received = new AtomicReference<>();
        TestingNettyConnectionWriter connectionWriter =
                new TestingNettyConnectionWriter.Builder()
                        .setWriteBufferFunction(
                                buffer -> {
                                    received.set(buffer);
                                    return null;
                                })
                        .build();
        subpartitionProducerAgent.connectionEstablished(connectionWriter);
        subpartitionProducerAgent.updateSegmentId(segmentId);

        assertThat(received.get().getSegmentId()).isEqualTo(segmentId);
    }