String rel = "foo-bar";
String linkHref = "http://example.org/link.html";
String preHref = "http://example.org/preload.html";
ModulePrefs prefs = new ModulePrefs(XmlUtil.parse(xml), SPEC_URL);
Substitutions subst = new Substitutions();
subst.addSubstitution(Substitutions.Type.MESSAGE, "title", title);
subst.addSubstitution(Substitutions.Type.MESSAGE, "icon", icon);
subst.addSubstitution(Substitutions.Type.MESSAGE, "rel", rel);
subst.addSubstitution(Substitutions.Type.MESSAGE, "link_href", linkHref);
subst.addSubstitution(Substitutions.Type.MESSAGE, "pre_href", preHref);
prefs = prefs.substitute(subst);
assertEquals(title, prefs.getTitle());
assertEquals(icon, prefs.getIcons().get(0).getContent());
assertEquals(rel, prefs.getLinks().get(rel).getRel());