### Question:
Connection { public void updateRecords(long app, List<Record> records) throws DBException { for (Record record: records) { Set<Map.Entry<String,Field>> set = record.getEntrySet(); for (Map.Entry<String,Field> entry: set) { Field field = entry.getValue(); lazyUpload(field); } } JsonParser parser = new JsonParser(); String json; try { json = parser.recordsToJsonForUpdate(app, records); } catch (IOException e) { throw new ParseException("failed to encode to json"); } request("PUT", "records.json", json); } Connection(String domain, String login, String password);  Connection(String domain, String apiToken); void close(); boolean isTrustAllHosts(); void setTrustAllHosts(boolean trustAllHosts); void setBasicAuth(final String username, final String password); long getGuestSpaceId(); void setGuestSpaceId(long guestSpaceId); void addHeader(String name, String value); void setProxy(String host, int port); void setClientCert(String cert, String password); String request(String method, String api, String body); Properties getProperties(); String request(String method, String api, String body, File outFile); ResultSet select(long app, String query); ResultSet selectWithTotalCount(long app, String query); ResultSet select(long app, String query, String[] columns); ResultSet selectWithTotalCount(long app, String query, String[] columns); long insert(long app, Record record); void lazyUpload(Field field); List<Long> insert(long app, List<Record> records); void update(long app, long id, Record record); long updateRecord(long app, Record record); void update(long app, List<Long> ids, Record record); void updateRecords(long app, List<Record> records); void updateByQuery(long app, String query, Record record); long updateRecordByKey(long app, String key, Record record); void updateRecordsByKey(long app, String key, List<Record> records); long updateAssignees(long app, long id, List<String> codes, long revision); long updateAssignees(long app, long id, List<String> codes); long updateStatus(long app, long id, String action, String assignee, long revision); long updateStatus(long app, long id, String action, String assignee); void updateStatus(long app, List<Long> ids, List<String> actions, List<String> assignees, List<Long> revisions); void delete(long app, long id); void deleteRecord(long app, Record record); void deleteRecords(long app, List<Record> records); void delete(long app, List<Long> ids); void deleteByQuery(long app, String query); String uploadFile(File file, String contentType); String uploadFile(File file); String uploadFile(String contentType, InputStream file, String fileName); File downloadFile(String fileKey); void bulkRequest(BulkRequest bulk); AppDto getApp(long id); List<AppDto> getApps(String name); List<AppDto> getApps(List<Long> ids, List<String> codes, 
    		String name, List<Long> spaceIds, long limit, long offset); long addComment(long app, long record, String text, List<MentionDto> mentions); void deleteComment(long app, long record, long id); CommentSet getComments(long app, long record, boolean descending, long limit, long offset); CommentSet getComments(long app, long record, boolean descending); static final String DEFAULT_CONTENT_TYPE; }### Answer:
@Test public void testUpdateRecords() { Connection db = getConnection(); long app = getAppId(); try { Record record; List<Record> records = new ArrayList<Record>(); List<Long> ids = insertRecords(); ResultSet rs = db.select(app, ""); if (rs.size() != 3) { fail("invalid count"); } while (rs.next()) { record = new Record(); record.setId(rs.getId()); record.setRevision(rs.getRevision()); record.setString("Single_line_text", "hoge"); records.add(record); } db.updateRecords(app, records); rs = db.select(app, "Single_line_text = \"hoge\""); if (rs.size() != 3) { fail("failed to update"); } } catch (Exception e) { fail("db exception:" + e.getMessage()); } }