### Question:
ExtensionInterpreter { public UsageExtensions interpret(NameUsage u, VerbatimNameUsage v) { UsageExtensions ext = new UsageExtensions(); interpretDescription(u, ext,v); interpretDistribution(u ,ext, v); interpretIdentifier(u, ext, v); interpretMultimedia(u, ext, v); interpretReference(u, ext, v); interpretSpeciesProfiles(u, ext, v); interpretTypes(u, ext, v); interpretVernacularNames(u, ext, v); return ext; }  UsageExtensions interpret(NameUsage u, VerbatimNameUsage v);  }### Answer:
@Test public void testEolMedia() throws Exception { ExtensionInterpreter interp = new ExtensionInterpreter(); NameUsage u = new NameUsage(); VerbatimNameUsage v = new VerbatimNameUsage(); Map<Term, String> doc1 = Maps.newHashMap(); doc1.put(DcTerm.type, "http: doc1.put(DcTerm.format, "image/jpeg"); doc1.put(DcTerm.language, "en"); doc1.put(DcTerm.identifier, "1013-sp1-Image-1"); doc1.put(DwcTerm.taxonID, "1013-sp1"); doc1.put(AcTerm.accessURI, "http: doc1.put(AcTerm.furtherInformationURL, "http: Map<Term, String> doc2 = Maps.newHashMap(); doc2.put(DcTerm.type, "http: doc2.put(DcTerm.format, "text/html"); doc2.put(DcTerm.language, "en"); doc2.put(DcTerm.identifier, "1013-sp1-text-3"); doc2.put(DwcTerm.taxonID, "1013-sp1"); doc2.put(DcTerm.description, "Eupolybothrus cavernicolus is so far known only from the caves Miljacka"); doc2.put(DcTerm.title, "Description of the type locality"); doc2.put(AcTerm.furtherInformationURL, "http: doc2.put(XmpRightsTerm.UsageTerms, "http: v.getExtensions().put(Extension.EOL_MEDIA, Lists.newArrayList(doc1, doc2)); UsageExtensions ext = interp.interpret(u, v); assertEquals(1, ext.media.size()); assertEquals(URI.create("http: assertEquals(URI.create("http: assertEquals(1, ext.descriptions.size()); assertEquals("Description of the type locality", ext.descriptions.get(0).getType()); assertEquals("http: assertEquals("Eupolybothrus cavernicolus is so far known only from the caves Miljacka", ext.descriptions.get(0).getDescription()); }
@Test public void testVernacularNames() throws Exception { ExtensionInterpreter interp = new ExtensionInterpreter(); NameUsage u = new NameUsage(); VerbatimNameUsage v = new VerbatimNameUsage(); Map<Term, String> v1 = Maps.newHashMap(); v1.put(DwcTerm.vernacularName, "palmeirinha"); v1.put(DcTerm.language, "PORTUGUES"); v1.put(DwcTerm.locality, "Acre"); Map<Term, String> v2 = Maps.newHashMap(); v2.put(DwcTerm.vernacularName, "ubim"); v2.put(DcTerm.language, "PORTUGUES"); v2.put(DwcTerm.locality, "Acre"); v.getExtensions().put(Extension.VERNACULAR_NAME, Lists.newArrayList(v1, v2)); UsageExtensions ext = interp.interpret(u, v); assertEquals(2, ext.vernacularNames.size()); assertTrue(u.getIssues().isEmpty()); assertEquals("palmeirinha", ext.vernacularNames.get(0).getVernacularName()); assertEquals(Language.PORTUGUESE, ext.vernacularNames.get(0).getLanguage()); assertEquals("Acre", ext.vernacularNames.get(0).getArea()); }