IssueLinkTypesJsonParser implements JsonParser<Iterable<IssuelinksType>> { @Override public Iterable<IssuelinksType> parse(JSONObject json) throws JSONException { return JsonParseUtil.parseJsonArray(json.optJSONArray("issueLinkTypes"), issueLinkTypeJsonParser); }  @Override Iterable<IssuelinksType> parse(JSONObject json);  }
@Test public void testParse() throws Exception { IssueLinkTypesJsonParser parser = new IssueLinkTypesJsonParser(); final Iterable<IssuelinksType> issueLinks = parser.parse(ResourceUtil .getJsonObjectFromResource("/json/issueLinks/issue-links-5.0.json")); assertEquals(8, Iterables.size(issueLinks)); assertEquals(new IssuelinksType(TestUtil.toUri("https: "10160", "Bonfire Testing", "discovered while testing", "testing discovered"), Iterables.get(issueLinks, 0)); assertEquals(new IssuelinksType(TestUtil.toUri("https: "10020", "Relates", "is related to", "relates to"), Iterables.getLast(issueLinks)); }