code: public static List<HostAndPort> hostAndPorts(AbstractConfig config, String key, Integer defaultPort) {
      final List<String> inputs = config.getList(key);
      List<HostAndPort> result = new ArrayList<>();
      for (final String input : inputs) {
        final HostAndPort hostAndPort = hostAndPort(input, defaultPort);
        result.add(hostAndPort);
      }
  
      return ImmutableList.copyOf(result);
    }
docs: Method is used to parse a list ConfigDef item to a list of HostAndPort
  
  @param config      Config to read from
  @param key         ConfigItem to get the host string from.
  @param defaultPort The default port to use if a port was not specified. Can be null.
  @return