### Question:
JDBCResultIterator implements ResultIterator<T> { @Override public T nextRow() { if (!hasNextRow()) { throw new NoSuchElementException("An attempt to read uninitialized row or past the end of the iterator."); } T row = rowReader.readRow(resultSet); checkNextRow(); return row; } JDBCResultIterator(Statement statement, ResultSet resultSet, RowReader<T> rowReader); @Override Iterator<T> iterator(); @Override List<T> allRows(); @Override boolean hasNextRow(); @Override T nextRow(); @Override void skipRow(); @Override void close();  }### Answer:
@Test public void testNextDataRow() throws Exception { Connection c = new MockConnection(); Statement s = new MockStatement(c); MockResultSet rs = new MockResultSet("rs"); rs.addColumn("a", new Object[] { "1", "2", "3" }); RowDescriptor descriptor = new RowDescriptorBuilder().setResultSet(rs).getDescriptor(new ExtendedTypeMap()); RowReader<?> rowReader = new DefaultRowReaderFactory().rowReader(descriptor, new MockQueryMetadata(), mock(DbAdapter.class), Collections.<ObjAttribute, ColumnDescriptor> emptyMap()); JDBCResultIterator it = new JDBCResultIterator(s, rs, rowReader); DataRow row = (DataRow) it.nextRow(); assertNotNull(row); assertEquals(1, row.size()); assertEquals("1", row.get("a")); }