### Question:
ModulePrefs { public Map<String, Feature> getViewFeatures(String view) { Map<String, Feature> map = Maps.newHashMap(); map.putAll(globalFeatures); for (Feature feature : features.values()) { if (feature.getViews().contains(view)) { map.put(feature.getName(), feature); } } return map; } ModulePrefs(Element element, Uri base); private  ModulePrefs(ModulePrefs prefs, Substitutions substituter); String getTitle(); Uri getTitleUrl(); String getDescription(); String getAuthor(); String getAuthorEmail(); Uri getScreenshot(); Uri getThumbnail(); String getDirectoryTitle(); String getAuthorAffiliation(); String getAuthorLocation(); Uri getAuthorPhoto(); String getAuthorAboutme(); String getAuthorQuote(); Uri getAuthorLink(); boolean getShowStats(); boolean getShowInDirectory(); boolean getSingleton(); boolean getScaling(); boolean getScrolling(); int getWidth(); int getHeight(); String getDoctype(); String getAttribute(String name); String getAttribute(String name, String defaultValue); Uri getUriAttribute(String name); boolean getBoolAttribute(String name); int getIntAttribute(String name); List<String> getCategories(); Map<String, Feature> getFeatures(); List<Feature> getAllFeatures(); Map<String, Feature> getViewFeatures(String view); List<Preload> getPreloads(); List<Icon> getIcons(); Map<Locale, LocaleSpec> getLocales(); Map<String, LinkSpec> getLinks(); OAuthSpec getOAuthSpec(); OAuth2Spec getOAuth2Spec(); Multimap<String,Node> getExtraElements(); boolean needsUserPrefSubstitution(); LocaleSpec getGlobalLocale(Locale locale); LocaleSpec getLocale(Locale locale, String view); ModulePrefs substitute(Substitutions substituter); @Override String toString();  }### Answer:
@Test public void getViewFeatures() throws Exception { ModulePrefs prefs = new ModulePrefs(XmlUtil.parse(FULL_XML), SPEC_URL); Map<String, Feature> features = prefs.getViewFeatures("default"); assertEquals(5, features.size()); assertTrue(features.containsKey("requiredview1")); assertTrue(features.containsKey("require")); assertTrue(features.containsKey("optional")); assertTrue(features.containsKey("core")); assertTrue(features.containsKey("security-token")); assertTrue(!features.containsKey("requiredview2")); features = prefs.getViewFeatures("view2"); assertEquals(5, features.size()); assertTrue(features.containsKey("requiredview2")); assertTrue(features.containsKey("require")); assertTrue(features.containsKey("optional")); assertTrue(features.containsKey("core")); assertTrue(features.containsKey("security-token")); assertTrue(!features.containsKey("requiredview1")); }
@Test public void getViewFeatureParams() throws Exception { ModulePrefs prefs = new ModulePrefs(XmlUtil.parse(FULL_XML), SPEC_URL); Map<String, Feature> features = prefs.getViewFeatures("view2"); String paramValue = features.get("require").getParam("param_name"); assertNotNull(paramValue); assertEquals("param_value", paramValue); }