### Question:
CitationParser { public Citation parse(String citationStr) throws HttpException, IOException, ParserConfigurationException, SAXException { PostMethod method = new PostMethod(url); method.addRequestHeader("accept", "text/xml"); method.addParameter("citation", citationStr); int statusCode = client.executeMethod(method); if (statusCode != -1) { InputStream in = method.getResponseBodyAsStream(); DocumentBuilderFactory dbFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(in); doc.getDocumentElement().normalize(); NodeList nodes = doc.getElementsByTagName("citation"); Node node = nodes.item(0); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; String isValid = element.getAttribute("valid"); if (isValid.equals("true")) { Citation citation = new Citation(); citation.setTitle(getValue("title", element)); citation.setYear(new Integer(getValue("year", element))); NodeList authors = element.getElementsByTagName("author"); for (int j = 0; j < authors.getLength(); j++) { Node author = authors.item(j); citation.addAuthor(author.getTextContent()); } return citation; } } } return null; } CitationParser(); Citation parse(String citationStr);  }### Answer:
@Test @Ignore public void test() throws Exception { Citation c = new CitationParser() .parse("Thomson AM & Bannister A. Postsynaptic pyramidal target selection by descending layer III pyramidal axons: dual intracellular recordings and biocytin filling in slices of rat neocortex. Neuroscience 84, 669–683 (1998)."); assertEquals( "Postsynaptic pyramidal target selection by descending layer III pyramidal axons: dual intracellular recordings and biocytin filling in slices of rat neocortex", c.getTitle()); assertEquals(1998, c.getYear()); assertEquals("[Thomson AM, A Bannister]", c.getAuthors().toString()); assertEquals( "tttit[title] AND me[author] AND 1234[Date - Publication]", new Citation().addAuthor("me").setYear(1234).setTitle("tttit") .toPubmedQueryString()); }