### Question:
YandexSearcher extends AbstractSearcher<WebContent> { List<WebContent> parse(Document document) throws SearcherException { Node responseNode = XPathHelper.getNode(document, "/yandexsearch/response"); if (responseNode == null) { throw new SearcherException("The response data could not be parsed. Maybe the API has changed."); } checkError(responseNode); List<Node> resultDocs = XPathHelper.getNodes(responseNode, "results/grouping/group/doc"); List<WebContent> result = new ArrayList<WebContent>(); for (Node resultDoc : resultDocs) { Node urlNode = XPathHelper.getNode(resultDoc, "url"); Node titleNode = XPathHelper.getNode(resultDoc, "title"); if (urlNode == null || titleNode == null) { throw new SearcherException("Expected element (url or title) was missing"); } BasicWebContent.Builder builder = new BasicWebContent.Builder(); builder.setUrl(urlNode.getTextContent()); builder.setTitle(titleNode.getTextContent()); Node headlineNode = XPathHelper.getNode(resultDoc, "headline"); if (headlineNode != null) { builder.setSummary(headlineNode.getTextContent()); } Node timeNode = XPathHelper.getNode(resultDoc, "modtime"); if (timeNode != null) { builder.setPublished(parseDate(timeNode.getTextContent())); } result.add(builder.create()); } return result; } YandexSearcher(String yandexSearchUrl);  YandexSearcher(Configuration configuration);   YandexSearcher(); @Override String getName(); @Override List<WebContent> search(String query, int resultCount, Language language); static int getRequestCount(); static final String CONFIG_SEARCH_URL; }### Answer:
@Test public void testParseResponse() throws FileNotFoundException, ParserException { Document document = xmlParser.parse(ResourceHelper.getResourceFile("/apiresponse/response1.xml")); try { List<WebContent> webResults = yandexSearcher.parse(document); assertEquals(10, webResults.size()); assertEquals("http: assertEquals("\"Mercedes-Benz in Russia\" - продажа автомобилей", webResults.get(0).getTitle()); assertEquals("Информация о работе дилеров и авторизованных техцентров. Каталог автомобилей. Рекомендованные розничные цены и специальные предложения. FAQ.", webResults.get(0).getSummary()); } catch (SearcherException e) { fail(); } document = xmlParser.parse(ResourceHelper.getResourceFile("/apiresponse/error2.xml")); try { yandexSearcher.parse(document); fail(); } catch (SearcherException e) { } }