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