public static boolean matchAnyDomain(String name, Collection<String> patterns) {
        if (patterns == null || patterns.isEmpty()) {
            return false;
        }
        for (String pattern : patterns) {
            if (matchDomain(name, pattern)) {
                return true;
            }
        }
        return false;
    }
@Test
    public void testMatchAnyDomain() {
        assertTrue(AddressUtil.matchAnyDomain("hazelcast.com", singletonList("hazelcast.com")));

        assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", null));
        assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", Collections.emptyList()));
        assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", singletonList("abc.com")));
    }