public static List<BindAddress> validateBindAddresses(ServiceConfiguration config, Collection<String> schemes) {
        // migrate the existing configuration properties
        List<BindAddress> addresses = migrateBindAddresses(config);

        // parse the list of additional bind addresses
        Arrays
                .stream(StringUtils.split(StringUtils.defaultString(config.getBindAddresses()), ","))
                .map(s -> {
                    Matcher m = BIND_ADDRESSES_PATTERN.matcher(s);
                    if (!m.matches()) {
                        throw new IllegalArgumentException("bindAddresses: malformed: " + s);
                    }
                    return m;
                })
                .map(m -> new BindAddress(m.group("name"), URI.create(m.group("url"))))
                .forEach(addresses::add);

        // apply the filter
        if (schemes != null) {
            addresses.removeIf(a -> !schemes.contains(a.getAddress().getScheme()));
        }

        return addresses;
    }
@Test
    public void testOneListenerMultipleAddresses() {
        ServiceConfiguration config = newEmptyConfiguration();
        config.setBindAddresses("internal:pulsar://0.0.0.0:6650,internal:pulsar+ssl://0.0.0.0:6651");
        List<BindAddress> addresses = BindAddressValidator.validateBindAddresses(config, null);
        assertEquals(Arrays.asList(
                new BindAddress("internal", URI.create("pulsar://0.0.0.0:6650")),
                new BindAddress("internal", URI.create("pulsar+ssl://0.0.0.0:6651"))), addresses);
    }