### Question:
LinkSpec { public String getMethod() { return method; } LinkSpec(Element element, Uri base); private  LinkSpec(LinkSpec rhs, Substitutions substitutions); String getRel(); Uri getHref(); String getMethod(); LinkSpec substitute(Substitutions substitutions); @Override String toString();  }### Answer:
@Test public void parseMethodAttribute() throws Exception { String xml = "<Link rel='" + REL_VALUE + "' href='" + HREF_VALUE + "'/>"; LinkSpec link = new LinkSpec(XmlUtil.parse(xml), SPEC_URL); assertEquals(DEFAULT_METHOD_VALUE, link.getMethod()); }
@Test public void parseAltMethodAttribute() throws Exception { String xml = "<Link rel='" + REL_VALUE + "' href='" + HREF_VALUE + "' method='POST'/>"; LinkSpec link = new LinkSpec(XmlUtil.parse(xml), SPEC_URL); assertEquals(METHOD_VALUE, link.getMethod()); }