@Test
public void testIsValidIpV6Address() {

    for (String host : validIpV6Hosts.keySet()) {
        assertTrue(host, isValidIpV6Address(host));
        if (host.charAt(0) != '[' && !host.contains("%")) {
            assertNotNull(host, getByName(host, true));
            String hostMod = '[' + host + ']';
            assertTrue(hostMod, isValidIpV6Address(hostMod));
            hostMod = host + '%';
            assertTrue(hostMod, isValidIpV6Address(hostMod));
            hostMod = host + "%eth1";
            assertTrue(hostMod, isValidIpV6Address(hostMod));
            hostMod = '[' + host + "%]";
            assertTrue(hostMod, isValidIpV6Address(hostMod));
            hostMod = '[' + host + "%1]";
            assertTrue(hostMod, isValidIpV6Address(hostMod));
            hostMod = '[' + host + "]%";
            assertFalse(hostMod, isValidIpV6Address(hostMod));
            hostMod = '[' + host + "]%1";
            assertFalse(hostMod, isValidIpV6Address(hostMod));
        }
    }
    for (String host : invalidIpV6Hosts.keySet()) {
        assertFalse(host, isValidIpV6Address(host));
        assertNull(host, getByName(host));
        String hostMod = '[' + host + ']';
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = host + '%';
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = host + "%eth1";
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = '[' + host + "%]";
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = '[' + host + "%1]";
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = '[' + host + "]%";
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = '[' + host + "]%1";
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = host + ']';
        assertFalse(hostMod, isValidIpV6Address(hostMod));
        hostMod = '[' + host;
        assertFalse(hostMod, isValidIpV6Address(hostMod));
    }
}