### Question:
ConceptMapperParser { public static Map<String, Concept> parse(File f) throws JDOMException, IOException { Map<String, Concept> concepts = newHashMap(); InputStream corpusIs = new FileInputStream(f); SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(corpusIs); Element rootNode = doc.getRootElement(); Iterator<Element> tokens = rootNode.getChildren().iterator(); while (tokens.hasNext()) { Element token = tokens.next(); String id = token.getAttributeValue("ref_id"); String canonical = token.getAttributeValue("canonical"); Set<String> variantStrings = newHashSet(); List<Element> variants = token.getChildren(); for (Element variant : variants) { variantStrings.add(variant.getAttributeValue("base").trim()); } concepts.put(id, new Concept(canonical, id, variantStrings)); } checkArgument(concepts.size() > 0, "empty concepts!"); return concepts; }  static Map<String, Concept> parse(File f);  }### Answer:
@Test public void test() throws Exception { File age = new File(XmlHelper.XML_TEST_RESOURCES + "ConceptMapperParser/age.xml"); Map<String, Concept> onto = ConceptMapperParser.parse(age); assertEquals(46, onto.size()); Concept infant = onto.get("age:INFANT"); assertEquals(4, infant.getVariants().size()); }