### Question:
TableRecords { public static TableRecords buildRecords(TableMeta tmeta, ResultSet resultSet) throws SQLException { TableRecords records = new TableRecords(tmeta); ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); int columnCount = resultSetMetaData.getColumnCount(); while (resultSet.next()) { List<Field> fields = new ArrayList<>(columnCount); for (int i = 1; i <= columnCount; i++) { String colName = resultSetMetaData.getColumnName(i); ColumnMeta col = tmeta.getColumnMeta(colName); int dataType = col.getDataType(); Field field = new Field(); field.setName(col.getColumnName()); if (tmeta.getPrimaryKeyMap().containsKey(colName)) { field.setKeyType(KeyType.PRIMARY_KEY); } field.setType(dataType); if (dataType == JDBCType.BLOB.getVendorTypeNumber()) { Blob blob = resultSet.getBlob(i); if (blob != null) { field.setValue(new SerialBlob(blob)); } } else if (dataType == JDBCType.CLOB.getVendorTypeNumber()) { Clob clob = resultSet.getClob(i); if (clob != null) { field.setValue(new SerialClob(clob)); } } else if (dataType == JDBCType.ARRAY.getVendorTypeNumber()) { Array array = resultSet.getArray(i); if (array != null) { field.setValue(new SerialArray(array)); } } else if (dataType == JDBCType.REF.getVendorTypeNumber()) { Ref ref = resultSet.getRef(i); if (ref != null) { field.setValue(new SerialRef(ref)); } } else if (dataType == JDBCType.DATALINK.getVendorTypeNumber()) { java.net.URL url = resultSet.getURL(i); if (url != null) { field.setValue(new SerialDatalink(url)); } } else if (dataType == JDBCType.JAVA_OBJECT.getVendorTypeNumber()) { Object object = resultSet.getObject(i); if (object != null) { field.setValue(new SerialJavaObject(object)); } } else { field.setValue(resultSet.getObject(i)); } fields.add(field); } Row row = new Row(); row.setFields(fields); records.add(row); } return records; } TableRecords();  TableRecords(TableMeta tableMeta); String getTableName(); void setTableName(String tableName); List<Row> getRows(); void setRows(List<Row> rows); void setTableMeta(TableMeta tableMeta); int size(); void add(Row row); List<Map<String,Field>> pkRows(); TableMeta getTableMeta(); static TableRecords empty(TableMeta tableMeta); static TableRecords buildRecords(TableMeta tmeta, ResultSet resultSet);  }### Answer:
@Test public void testBuildRecords() throws SQLException { MockDriver mockDriver = new MockDriver(returnValueColumnLabels, returnValue, columnMetas, indexMetas); DruidDataSource dataSource = new DruidDataSource(); dataSource.setUrl("jdbc:mock:xxx"); dataSource.setDriver(mockDriver); MockStatementBase mockStatement = new MockStatement(dataSource.getConnection().getConnection()); DataSourceProxy proxy = new DataSourceProxy(dataSource); TableMeta tableMeta = TableMetaCacheFactory.getTableMetaCache(JdbcConstants.MYSQL).getTableMeta(proxy.getPlainConnection(), "table_records_test", proxy.getResourceId()); ResultSet resultSet = mockDriver.executeQuery(mockStatement, "select * from table_records_test"); TableRecords tableRecords = TableRecords.buildRecords(tableMeta, resultSet); Assertions.assertNotNull(tableRecords); }