public void close() {
        bufferAccumulator.close();
        tierProducerAgents.forEach(TierProducerAgent::close);
    }
@TestTemplate
    void testClose() {
        int numSubpartitions = 10;

        AtomicBoolean isClosed = new AtomicBoolean(false);
        TestingTierProducerAgent tierProducerAgent =
                new TestingTierProducerAgent.Builder()
                        .setCloseRunnable(() -> isClosed.set(true))
                        .build();

        TieredStorageProducerClient tieredStorageProducerClient =
                createTieredStorageProducerClient(
                        numSubpartitions, Collections.singletonList(tierProducerAgent));

        assertThat(isClosed.get()).isFalse();
        tieredStorageProducerClient.close();
        assertThat(isClosed.get()).isTrue();
    }