### Question:
UrlFunctions { @Description("Unescape a URL-encoded string") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") public static Slice urlDecode(@SqlType("varchar(x)") Slice value) { return decodeUrl(value.toStringUtf8()); } private  UrlFunctions(); @SqlNullable @Description("Extract protocol from url") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") static Slice urlExtractProtocol(@SqlType("varchar(x)") Slice url); @SqlNullable @Description("Extract host from url") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") static Slice urlExtractHost(@SqlType("varchar(x)") Slice url); @SqlNullable @Description("Extract port from url") @ScalarFunction @LiteralParameters("x") @SqlType(StandardTypes.BIGINT) static Long urlExtractPort(@SqlType("varchar(x)") Slice url); @SqlNullable @Description("Extract part from url") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") static Slice urlExtractPath(@SqlType("varchar(x)") Slice url); @SqlNullable @Description("Extract query from url") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") static Slice urlExtractQuery(@SqlType("varchar(x)") Slice url); @SqlNullable @Description("Extract fragment from url") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") static Slice urlExtractFragment(@SqlType("varchar(x)") Slice url); @SqlNullable @Description("Extract query parameter from url") @ScalarFunction @LiteralParameters({"x", "y"}) @SqlType("varchar(x)") static Slice urlExtractParameter(@SqlType("varchar(x)") Slice url, @SqlType("varchar(y)") Slice parameterName); @Description("Escape a string for use in URL query parameter names and values") @ScalarFunction @LiteralParameters({"x", "y"}) @Constraint(variable = "y", expression = "min(2147483647, x * 12)") @SqlType("varchar(y)") static Slice urlEncode(@SqlType("varchar(x)") Slice value); @Description("Unescape a URL-encoded string") @ScalarFunction @LiteralParameters("x") @SqlType("varchar(x)") static Slice urlDecode(@SqlType("varchar(x)") Slice value);  }### Answer:
@Test public void testUrlDecode() { String[][] inputOutputPairs = { {"http%3A%2F%2Ftest", "http: {"http%3A%2F%2Ftest%3Fa%3Db%26c%3Dd", "http: {"http%3A%2F%2F%E3%83%86%E3%82%B9%E3%83%88", "http: {"%7E%40%3A.-*_%2B+%E2%98%83", "~@:.-*_+ \u2603"}, {"test", "test"}, }; for (String[] inputOutputPair : inputOutputPairs) { String input = inputOutputPair[0]; String output = inputOutputPair[1]; assertFunction("url_decode('" + input + "')", createVarcharType(input.length()), output); } }