### Question:
UrlUtils { public static String urlEncode(final String str) { if (str == null) { return ""; } return new UrlEncoder(str, false, false).encode(); } UrlUtils(); static String concatUrlPaths(final String base, final String path); static Map<String, String> urlDecodeParams(final String str); static MultivaluedMap<String, String> urlDecodeMultivaluedParams(final String str); static String urlEncodeParams(final Map<String, String> params); static String urlEncodeMultivaluedParams(final MultivaluedMap<String, String> params); static String urlEncode(final String str); static String urlDecode(final String str); static String urlEncode(final String str, final boolean ignoreTemplates, final boolean ignoreSlashes);  }### Answer:
@Test public void testUrlEncodeIgnoreTemplates() { assertEquals("foo", UrlUtils.urlEncode("foo", true, false)); assertEquals("123", UrlUtils.urlEncode("123", true, false)); assertEquals("a%20b", UrlUtils.urlEncode("a b", true, false)); assertEquals("foo{bar}", UrlUtils.urlEncode("foo{bar}", true, false)); assertEquals("foo{bar:[a-z]{1-3}}", UrlUtils.urlEncode("foo{bar:[a-z]{1-3}}", true, false)); assertEquals("%f0%9f%98%81", UrlUtils.urlEncode(new String( new byte[] { (byte) 0xF0, (byte) 0x9F, (byte) 0x98, (byte) 0x81 }, StandardCharsets.UTF_8), true, false)); }