### Question:
GremlinServerStatementResult implements StatementResult { @Override public List<Record> list() { ArrayList<Record> list = new ArrayList<>(); iterator.forEachRemaining(e -> list.add(converter.toRecord(e))); return list; } GremlinServerStatementResult(ServerInfo serverInfo,
                                 Statement statement,
                                 Iterator<Map<String, Object>> iterator,
                                 GremlinCypherValueConverter converter); @Override List<String> keys(); @Override boolean hasNext(); @Override Record next(); @Override Record single(); @Override Record peek(); @Override List<Record> list(); @Override List<T> list(Function<Record, T> mapFunction); @Override ResultSummary consume(); @Override ResultSummary summary();  }### Answer:
@Test public void map() { List<Map<String, Object>> results = asList( getRow(1), getRow(2) ); StatementResult statementResult = new GremlinServerStatementResult(serverInfo, statement, results.iterator(), converter); assertThat(statementResult.list(r -> r.get(KEY2).asString())) .containsExactly("value1", "value2"); }