@Override
    public MetadataRequest.Builder buildRequest(Set<BrokerKey> keys) {
        validateLookupKeys(keys);
        // Send empty `Metadata` request. We are only interested in the brokers from the response
        return new MetadataRequest.Builder(new MetadataRequestData());
    }
@Test
    public void testBuildRequestWithInvalidLookupKeys() {
        AllBrokersStrategy strategy = new AllBrokersStrategy(logContext);
        AllBrokersStrategy.BrokerKey key1 = new AllBrokersStrategy.BrokerKey(OptionalInt.empty());
        AllBrokersStrategy.BrokerKey key2 = new AllBrokersStrategy.BrokerKey(OptionalInt.of(1));
        assertThrows(IllegalArgumentException.class, () -> strategy.buildRequest(mkSet(key1)));
        assertThrows(IllegalArgumentException.class, () -> strategy.buildRequest(mkSet(key2)));
        assertThrows(IllegalArgumentException.class, () -> strategy.buildRequest(mkSet(key1, key2)));

        Set<AllBrokersStrategy.BrokerKey> keys = new HashSet<>(AllBrokersStrategy.LOOKUP_KEYS);
        keys.add(key2);
        assertThrows(IllegalArgumentException.class, () -> strategy.buildRequest(keys));
    }