### Question:
PrettyConfig { public boolean isViewMapped(String viewId) { if (viewId != null) { viewId = viewId.trim(); PrettyUrlMapping needle = new PrettyUrlMapping(); needle.setViewId(viewId); if (viewId.startsWith("/")) { if (getMappings().contains(needle)) { return true; } needle.setViewId(viewId.substring(1)); } return getMappings().contains(needle); } return false; }  List<PrettyUrlMapping> getMappings(); void setMappings(final List<PrettyUrlMapping> mappings); void addMapping(final PrettyUrlMapping mapping); PrettyUrlMapping getMappingForUrl(final String url); boolean isMappingId(final String action); boolean isURLMapped(final String url); boolean isViewMapped(String viewId); PrettyUrlMapping getMappingById(String id); 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)); }