public Builder setListeners(List<Endpoint> listeners) {
            Map<String, Endpoint> listenersMap = new HashMap<>();
            for (Endpoint endpoint : listeners) {
                listenersMap.put(endpoint.listenerName().get(), endpoint);
            }
            this.listeners = listenersMap;
            return this;
        }
An immutable class which represents broker registrations.
metadata/src/main/java/org/apache/kafka/metadata/BrokerRegistration.java