AtomFeedXmlReader implements AtomFeedReader { @Override public final List<URI> readAtomFeed(final InputStream in) { final Document doc = parseDocument(createDocumentBuilder(), in); final XPath xPath = createXPath("ns", "http: final NodeList nodeList = findNodes(doc, xPath, "/ns:feed/ns:entry/ns:id"); final List<URI> uris = new ArrayList<>(); for (int i = 0; i < nodeList.getLength(); i++) { final Node node = nodeList.item(i); final String text = node.getTextContent(); try { uris.add(Utils4J.url(text).toURI()); } catch (final URISyntaxException ex) { throw new RuntimeException("Couldn't create URI: " + text); } } return uris; }  @Override final List<URI> readAtomFeed(final InputStream in); @Override final CommonEvent readEvent(final DeserializerRegistry desRegistry, final InputStream in); final AtomEntry<Node> readAtomEntry(final InputStream in);  }
@Test public void testReadAtomFeed() throws IOException, URISyntaxException { final AtomFeedXmlReader testee = new AtomFeedXmlReader(); final InputStream in = this.getClass().getResourceAsStream("/atom-feed-stream.xml"); try { final List<URI> uris = testee.readAtomFeed(in); assertThat(uris).containsExactly(new URI("classpath: new URI("classpath: } finally { in.close(); } }