### Question:
PrettyConfig { public boolean isViewMapped(String viewId) { if (viewId != null) { viewId = viewId.trim(); for (UrlMapping mapping : mappings) { if (viewId.equals(mapping.getViewId()) || (viewId.startsWith("/") && viewId.substring(1).equals(mapping.getViewId()))) { return true; } } } return false; } 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 isViewMapped() throws Exception { assertTrue(config.isViewMapped("/faces/view.jsf")); assertFalse(config.isViewMapped("/faces/view2.jsf")); }
@Test public void isNullViewMappedReturnsFalse() throws Exception { assertFalse(config.isViewMapped(null)); }