@Override
    public LookupResult<BrokerKey> handleResponse(Set<BrokerKey> keys, AbstractResponse abstractResponse) {
        validateLookupKeys(keys);

        MetadataResponse response = (MetadataResponse) abstractResponse;
        MetadataResponseData.MetadataResponseBrokerCollection brokers = response.data().brokers();

        if (brokers.isEmpty()) {
            log.debug("Metadata response contained no brokers. Will backoff and retry");
            return LookupResult.empty();
        } else {
            log.debug("Discovered all brokers {} to send requests to", brokers);
        }

        Map<BrokerKey, Integer> brokerKeys = brokers.stream().collect(Collectors.toMap(
            broker -> new BrokerKey(OptionalInt.of(broker.nodeId())),
            MetadataResponseData.MetadataResponseBroker::nodeId
        ));

        return new LookupResult<>(
            Collections.singletonList(ANY_BROKER),
            Collections.emptyMap(),
            brokerKeys
        );
    }
@Test
    public void testHandleResponseWithNoBrokers() {
        AllBrokersStrategy strategy = new AllBrokersStrategy(logContext);

        MetadataResponseData response = new MetadataResponseData();

        AdminApiLookupStrategy.LookupResult<AllBrokersStrategy.BrokerKey> lookupResult = strategy.handleResponse(
            AllBrokersStrategy.LOOKUP_KEYS,
            new MetadataResponse(response, ApiKeys.METADATA.latestVersion())
        );

        assertEquals(Collections.emptyMap(), lookupResult.failedKeys);
        assertEquals(Collections.emptyMap(), lookupResult.mappedKeys);
    }