public boolean hasAnyPendingRequests() {
        return client.hasInFlightRequests() || !unsentRequests.isEmpty();
    }
@Test
    public void testHasAnyPendingRequests() throws Exception {
        try (NetworkClientDelegate networkClientDelegate = newNetworkClientDelegate()) {
            NetworkClientDelegate.UnsentRequest unsentRequest = newUnsentFindCoordinatorRequest();
            networkClientDelegate.add(unsentRequest);

            // unsent
            assertTrue(networkClientDelegate.hasAnyPendingRequests());
            assertFalse(networkClientDelegate.unsentRequests().isEmpty());
            assertFalse(client.hasInFlightRequests());

            networkClientDelegate.poll(0, time.milliseconds());

            // in-flight
            assertTrue(networkClientDelegate.hasAnyPendingRequests());
            assertTrue(networkClientDelegate.unsentRequests().isEmpty());
            assertTrue(client.hasInFlightRequests());

            client.respond(FindCoordinatorResponse.prepareResponse(Errors.NONE, GROUP_ID, mockNode()));
            networkClientDelegate.poll(0, time.milliseconds());

            // get response
            assertFalse(networkClientDelegate.hasAnyPendingRequests());
            assertTrue(networkClientDelegate.unsentRequests().isEmpty());
            assertFalse(client.hasInFlightRequests());
        }
    }