### Question:
ApplicationManifest { public Uri getGadget(String version) { return gadgets.get(version); } ApplicationManifest(Uri uri, Element xml); Uri getUri(); Uri getGadget(String version); String getVersion(String label); static final String NAMESPACE; }### Answer:
@Test public void getGadget() throws Exception { String xml = "<app xmlns='" + ApplicationManifest.NAMESPACE + "'>" + "<gadget>" + " <label>development</label>" + " <version>2.0</version>" + " <spec>app2.xml</spec>" + "</gadget>" + "<gadget>" + " <label>production</label>" + " <version>1.0</version>" + " <spec>app.xml</spec>" + "</gadget></app>"; ApplicationManifest manifest = new ApplicationManifest(BASE_URI, XmlUtil.parse(xml)); assertEquals(BASE_URI.resolve(Uri.parse("app.xml")), manifest.getGadget("1.0")); assertEquals(BASE_URI.resolve(Uri.parse("app2.xml")), manifest.getGadget("2.0")); }