### Question:
ListGridRecordFactory { public ListGridRecord[] newListGridRecords(List<JsonNode> nodes) { final ListGridRecord[] records = new ListGridRecord[nodes.size()]; for (int i = 0; i < records.length; i++) { records[i] = newListGridRecord(nodes.get(i)); } return records; } @Inject  ListGridRecordFactory(RecordJSONUpdater updater); ListGridRecord newListGridRecord(JsonNode node); ListGridRecord[] newListGridRecords(List<JsonNode> nodes);  }### Answer:
@Test public void test_createsRecordsArrayMatchingSizeOfNodesList() { final ArrayList<JsonNode> nodes = Lists.<JsonNode> newArrayList(aJsonObject()); assertEquals(nodes.size(), recordFactory.newListGridRecords(nodes).length); }
@Test public void test_callsUpdaterOnRecordsArrayCreation() { final ArrayList<JsonNode> nodes = Lists.<JsonNode> newArrayList(aJsonObject(), aJsonObject()); final ListGridRecord[] records = recordFactory.newListGridRecords(nodes); verify(updater).update(records[0], nodes.get(0)); verify(updater).update(records[1], nodes.get(1)); }