static boolean isMulticastAddress(final String hostAndPort)
    {
        ParseResult result = tryParseIpV4(hostAndPort);
        if (null != result)
        {
            final String host = result.host;
            for (int i = 0, dotIndex = 0, end = host.length() - 1; i <= end; i++)
            {
                final char c = host.charAt(i);
                if ('.' == c || end == i)
                {
                    final int length = end == i ? i - dotIndex : i - 1 - dotIndex;
                    if (length <= 0 || length > 3)
                    {
                        return false;
                    }
                    if (0 == dotIndex)
                    {
                        final int firstByte = AsciiEncoding.parseIntAscii(host, 0, i);
                        // IPv4 multicast addresses are defined by the most-significant bit pattern of 1110
                        if (firstByte > 0xFF || 0xE0 != (firstByte & 0xF0))
                        {
                            return false;
                        }
                    }
                    dotIndex = i;
                }
                else if (c < '0' || c > '9')
                {
                    return false;
                }
            }
            return true;
        }
        else
        {
            result = tryParseIpV6(hostAndPort);
            if (null != result)
            {
                final String firstByte = result.host.substring(0, 2);
                return "ff".equalsIgnoreCase(firstByte);
            }
            throw new IllegalArgumentException("invalid format: " + hostAndPort);
        }
    }
@Test
    void shouldThrowNullPointerExceptionIfValueIsNull()
    {
        assertThrowsExactly(NullPointerException.class, () -> SocketAddressParser.isMulticastAddress(null));
    }