### Question:
PrettyURLBuilder { @Deprecated public String build(final UrlMapping mapping, final Map<String, String[]> parameters) { return build(mapping, false, parameters); }  List<UIParameter> extractParameters(final UIComponent component); @Deprecated String build(final UrlMapping mapping, final Map<String, String[]> parameters); String build(final UrlMapping mapping, final boolean encodeUrl, final Map<String, String[]> parameters); @Deprecated String build(final UrlMapping mapping, final Object... parameters); String build(final UrlMapping mapping, final boolean encodeUrl, final Object... parameters); @Deprecated String build(final UrlMapping mapping, final RequestParameter... parameters); String build(final UrlMapping mapping, final boolean encodeUrl, final RequestParameter... parameters); @Deprecated String build(final UrlMapping urlMapping, final List<UIParameter> parameters); String build(final UrlMapping urlMapping, final boolean encodeUrl, final List<UIParameter> parameters);  }### Answer:
@Test public void testBuildMappedUrlPrettyUrlMappingSingleParameterContainingList() { List<UIParameter> parameters = new ArrayList<UIParameter>(); UIParameter param = new UIParameter(); param.setValue(values); parameters.add(param); String mappedUrl = builder.build(mapping, false, parameters); assertTrue(mappedUrl.startsWith(expectedPath)); }
@Test public void testBuildMappedUrlPrettyUrlMappingSingleParameterContainingArray() { List<UIParameter> parameters = new ArrayList<UIParameter>(); UIParameter param = new UIParameter(); param.setValue(valuesArray); parameters.add(param); String mappedUrl = builder.build(mapping, false, parameters); assertTrue(mappedUrl.startsWith(expectedPath)); }
@Test(expected = PrettyException.class) public void testBuildMappedUrlPrettyUrlMappingSingleNamedParameterDefaultsToNonListBuild() { List<UIParameter> parameters = new ArrayList<UIParameter>(); UIParameter param = new UIParameter(); param.setValue(values); param.setName("something"); parameters.add(param); builder.build(mapping, false, parameters); }
@Test public void testBuildUrlWithUnicodeCharacters() { List<UIParameter> params = Arrays.asList( createUIParameter(null, "\u20ac"), createUIParameter(null, "\u0142"), createUIParameter("key1", "\u00a3"), createUIParameter("key2", "\u0644") ); String encodedUrl = builder.build(mapping, true, params); assertTrue(encodedUrl.startsWith("/test/%E2%82%AC/mapping/%C5%82?")); assertTrue(encodedUrl.contains("key1=%C2%A3")); assertTrue(encodedUrl.contains("key2=%D9%84")); String unicodeUrl = builder.build(mapping, false, params); assertTrue(unicodeUrl.startsWith("/test/\u20ac/mapping/\u0142?")); assertTrue(unicodeUrl.contains("key1=%C2%A3")); assertTrue(unicodeUrl.contains("key2=%D9%84")); String oldUrl = builder.build(mapping, false, params); assertTrue(oldUrl.startsWith("/test/\u20ac/mapping/\u0142?")); assertTrue(oldUrl.contains("key1=%C2%A3")); assertTrue(oldUrl.contains("key2=%D9%84")); }