### Question:
SQLiteWrapper extends SQLDatabase { @Override public int update(String table, ContentValues values, String whereClause, String[] whereArgs) { if (values == null || values.size() == 0) { throw new IllegalArgumentException("Empty values"); } try { String updateQuery = QueryBuilder.buildUpdateQuery(table, values, whereClause, whereArgs); Object[] bindArgs = QueryBuilder.buildBindArguments(values, whereArgs); this.executeSQLStatement(updateQuery, bindArgs); return getConnection().getChanges(); } catch (SQLiteException e) { logger.log(Level.SEVERE, String.format("Error updating: %s, %s, %s, %s", table, values, whereClause, Arrays.toString(whereArgs)), e); return -1; } } SQLiteWrapper(File databaseFile); static SQLiteWrapper open(File databaseFile); SQLiteConnection getConnection(); SQLiteConnection createNewConnection(); @Override void open(); @Override void compactDatabase(); @Override int getVersion(); @Override boolean isOpen(); @Override void beginTransaction(); @Override void endTransaction(); @Override void setTransactionSuccessful(); @Override void close(); @Override void execSQL(String sql); @Override void execSQL(String sql, Object[] bindArgs); @Override int update(String table, ContentValues values, String whereClause, String[] whereArgs); @Override SQLiteCursor rawQuery(String sql, String[] bindArgs); @Override int delete(String table, String whereClause, String[] whereArgs); @Override long insertWithOnConflict(String table, ContentValues initialValues, int conflictAlgorithm); @Override long insert(String table, ContentValues initialValues);  }### Answer:
@Test public void update() throws Exception { prepareDatabaseForTesting(); int n = SQLiteWrapperUtils.intForQuery(conn, "SELECT count(*) FROM docs", new Object[]{}); Assert.assertEquals(4, n); int n2 = SQLiteWrapperUtils.intForQuery(conn, "SELECT count(*) FROM docs WHERE doc_name = ?", new Object[]{"haha"}); Assert.assertEquals(2, n2); ContentValues cv = new ContentValues(); cv.put("doc_name", "yaya"); String whereClause = " doc_name = ? "; String[] whereArgs = new String[]{"haha"}; Assert.assertEquals(2, database.update(doc_table_name, cv, whereClause, whereArgs)); ContentValues cv2 = new ContentValues(); cv2.put("doc_name", "lala"); String whereClause2 = " doc_id = ? "; String[] whereArgs2 = new String[]{"3"}; Assert.assertEquals(1, database.update(doc_table_name, cv2, whereClause2, whereArgs2)); }