### Question:
EdgeMetadata { public Iterable<String> toIterable(CSVRecord record) { return () -> new Iterator<String>() { int currentColumnIndex = firstColumnIndex - 1; @Override public boolean hasNext() { return currentColumnIndex < record.size(); } @Override public String next() { if (currentColumnIndex < firstColumnIndex) { currentColumnIndex++; return idGenerator.get(); } else { int headerIndex = currentColumnIndex - firstColumnIndex + 1; Header header = headers.get(headerIndex); PropertyValue propertyValue = propertyValueParser.parse(record.get(currentColumnIndex)); header.updateDataType(propertyValue.dataType()); currentColumnIndex++; return propertyValue.value(); } } }; } private  EdgeMetadata(Headers headers,
                         int firstColumnIndex,
                         Supplier<String> idGenerator,
                         PropertyValueParser parser); static EdgeMetadata parse(CSVRecord record, PropertyValueParser parser); List<String> headers(); boolean isEdge(CSVRecord record); Iterable<String> toIterable(CSVRecord record);  }### Answer:
@Test public void shouldWrapRecordWithEdgeSpecificIterable() { String columnHeaders = "\"_id\",\"_labels\",\"address\",\"name\",\"index\",\"txid\",\"_start\",\"_end\",\"_type\",\"strength\",\"timestamp\""; EdgeMetadata edgeMetadata = createEdgeMetadata(columnHeaders); CSVRecord record = CSVUtils.firstRecord(",,,,,,\"1\",\"2\",\"KNOWS\",\"10\",\"12345\""); Iterable<String> edge = edgeMetadata.toIterable(record); String expected = "edge-id,1,2,KNOWS,10,12345"; assertEquals(expected, String.join(",", edge)); }