BasicProjectsJsonParser implements JsonArrayParser<Iterable<BasicProject>> { @Override public Iterable<BasicProject> parse(JSONArray json) throws JSONException { ArrayList<BasicProject> res = new ArrayList<BasicProject>(json.length()); for (int i = 0; i < json.length(); i++) { res.add(basicProjectJsonParser.parse(json.getJSONObject(i))); } return res; }  @Override Iterable<BasicProject> parse(JSONArray json);  }
@Test public void testParse() throws Exception { BasicProjectsJsonParser parser = new BasicProjectsJsonParser(); final Iterable<BasicProject> project = parser.parse(ResourceUtil.getJsonArrayFromResource("/json/project/projects.json")); assertEquals(3, Iterables.size(project)); assertEquals(TST_PROJECT, Iterables.get(project, 0)); }