### Question:
PrettyConfig { public UrlMapping getMappingForUrl(final URL url) { final String mappingKey = url.toURL(); if (cachedMappings.containsKey(mappingKey)) { return cachedMappings.get(mappingKey); } for (UrlMapping mapping : getMappings()) { if (mapping.matches(url)) { if (!mapping.getPatternParser().isElPattern()) { cachedMappings.put(mappingKey, mapping); } return mapping; } } return null; } PrettyConfig(); void setDynaviewId(final String facesDynaViewId); String getDynaviewId(); List<RewriteRule> getGlobalRewriteRules(); void setGlobalRewriteRules(final List<RewriteRule> rules); List<UrlMapping> getMappings(); void setMappings(final List<UrlMapping> mappings); UrlMapping getMappingForUrl(final URL url); boolean isMappingId(final String id); boolean isURLMapped(final URL url); boolean isViewMapped(String viewId); UrlMapping getMappingById(String id); boolean isUseEncodeUrlForRedirects(); void setUseEncodeUrlForRedirects(boolean useEncodeUrlForRedirects); @Override String toString(); static final String CONFIG_REQUEST_KEY; }### Answer:
@Test public void testGetMappingForUrl() { UrlMapping mapping2 = config.getMappingForUrl(new URL("/home/en/test/")); assertEquals(mapping, mapping2); }