static InetSocketAddress parse(
        final String value, final String uriParamName, final boolean isReResolution, final NameResolver nameResolver)
    {
        if (Strings.isEmpty(value))
        {
            throw new NullPointerException("input string must not be null or empty");
        }

        final String nameAndPort = nameResolver.lookup(value, uriParamName, isReResolution);
        ParseResult result = tryParseIpV4(nameAndPort);
        if (null == result)
        {
            result = tryParseIpV6(nameAndPort);
        }
        if (null == result)
        {
            throw new IllegalArgumentException("invalid format: " + nameAndPort);
        }

        final InetAddress inetAddress = nameResolver.resolve(result.host, uriParamName, isReResolution);
        return null == inetAddress ? InetSocketAddress.createUnresolved(result.host, result.port) :
        new InetSocketAddress(inetAddress, result.port);
    }
@Test
    void shouldRejectOnEmptyIpV6Port()
    {
        assertThrows(IllegalArgumentException.class, () -> SocketAddressParser.parse(
            "[::1]:", ENDPOINT_PARAM_NAME, false, DEFAULT_RESOLVER));
    }