@Override
    public boolean needAnnounceBacklog() {
        return initialCredit == 0 && numCreditsAvailable == 0;
    }
@Test
    void testNeedAnnounceBacklog() throws Exception {
        int numCredits = 2;
        CreditBasedSequenceNumberingViewReader reader1 =
                createNetworkSequenceViewReader(numCredits);

        assertThat(reader1.needAnnounceBacklog()).isFalse();
        reader1.addCredit(-numCredits);
        assertThat(reader1.needAnnounceBacklog()).isFalse();

        CreditBasedSequenceNumberingViewReader reader2 = createNetworkSequenceViewReader(0);
        assertThat(reader2.needAnnounceBacklog()).isTrue();

        reader2.addCredit(numCredits);
        assertThat(reader2.needAnnounceBacklog()).isFalse();

        reader2.addCredit(-numCredits);
        assertThat(reader2.needAnnounceBacklog()).isTrue();
    }