AtomFeedJsonReader implements AtomFeedReader { @Override public final List<URI> readAtomFeed(final InputStream in) { final List<URI> uris = new ArrayList<>(); try (final JsonReader jsonReader = Json.createReader(new InputStreamReader(in))) { final JsonObject jsonObj = jsonReader.readObject(); final JSONArray read = JsonPath.read(jsonObj, "$.entries..id"); if (read != null) { for (int i = 0; i < read.size(); i++) { final JsonString id = (JsonString) read.get(i); final String uri = id.getString(); try { uris.add(Utils4J.url(uri).toURI()); } catch (final URISyntaxException ex) { throw new RuntimeException("Couldn't create URI: " + uri); } } } } return uris; }  @Override final List<URI> readAtomFeed(final InputStream in); @Override final CommonEvent readEvent(final DeserializerRegistry desRegistry, final InputStream in); final AtomEntry<JsonObject> readAtomEntry(final InputStream in);  }
@Test public void testReadAtomFeed() throws IOException, URISyntaxException { final AtomFeedJsonReader testee = new AtomFeedJsonReader(); final InputStream in = this.getClass().getResourceAsStream("/atom-feed-stream.json"); try { final List<URI> uris = testee.readAtomFeed(in); assertThat(uris).containsExactly(new URI("classpath: new URI("classpath: } finally { in.close(); } }