@Override
    public AvailabilityWithBacklog getAvailabilityAndBacklog(boolean isCreditAvailable) {
        if (findCurrentNettyPayloadQueue()) {
            NettyPayloadManager currentQueue =
                    nettyPayloadManagers.get(managerIndexContainsCurrentSegment);
            boolean availability = isCreditAvailable;
            if (!isCreditAvailable && isEventOrError(currentQueue)) {
                availability = true;
            }
            return new AvailabilityWithBacklog(availability, getBacklog());
        }
        return new AvailabilityWithBacklog(false, 0);
    }
@Test
    void testGetAvailabilityAndBacklog() {
        ResultSubpartitionView.AvailabilityWithBacklog availabilityAndBacklog1 =
                tieredStorageResultSubpartitionView.getAvailabilityAndBacklog(false);
        assertThat(availabilityAndBacklog1.getBacklog()).isEqualTo(1);
        assertThat(availabilityAndBacklog1.isAvailable()).isEqualTo(false);
        ResultSubpartitionView.AvailabilityWithBacklog availabilityAndBacklog2 =
                tieredStorageResultSubpartitionView.getAvailabilityAndBacklog(true);
        assertThat(availabilityAndBacklog2.getBacklog()).isEqualTo(1);
        assertThat(availabilityAndBacklog2.isAvailable()).isEqualTo(true);
    }