@Override
    public boolean invoke(ClientInvocation invocation) {
        ClientConnection connection = connectionManager.getRandomConnection();
        if (connection == null) {
            if (invocationLogger.isFinestEnabled()) {
                invocationLogger.finest("No connection found to invoke");
            }
            return false;
        }
        return send(invocation, connection);
    }
@Test
    public void testCleanResourcesTask_rejectsPendingInvocationsWithClosedConnections() {
        ClientConnection closedConn = closedConnection();
        ClientInvocation invocation = new ClientInvocation(client, ClientPingCodec.encodeRequest(), null, closedConn);

        ClientInvocationFuture future = invocation.invoke();
        assertTrueEventually(() -> assertTrue(future.isDone() && future.isCompletedExceptionally()));
    }