@Override
    public int getPoolSize() {
        return poolSize.get();
    }
@Test
    void testPoolSizeCheck() throws Exception {
        final int requiredBuffers = 10;
        final int maxBuffers = 100;
        CompletableFuture<Void> triggerGlobalDecision = new CompletableFuture<>();

        NetworkBufferPool networkBufferPool = new NetworkBufferPool(maxBuffers, bufferSize);
        BufferPool bufferPool = networkBufferPool.createBufferPool(requiredBuffers, maxBuffers);
        assertThat(bufferPool.getNumBuffers()).isEqualTo(maxBuffers);

        HsSpillingStrategy spillingStrategy =
                TestingSpillingStrategy.builder()
                        .setDecideActionWithGlobalInfoFunction(
                                (spillingInfoProvider) -> {
                                    assertThat(spillingInfoProvider.getPoolSize())
                                            .isEqualTo(requiredBuffers);
                                    triggerGlobalDecision.complete(null);
                                    return Decision.NO_ACTION;
                                })
                        .build();

        createMemoryDataManager(spillingStrategy, bufferPool);
        networkBufferPool.createBufferPool(maxBuffers - requiredBuffers, maxBuffers);
        assertThat(bufferPool.getNumBuffers()).isEqualTo(requiredBuffers);

        assertThatFuture(triggerGlobalDecision).eventuallySucceeds();
    }