diff --git a/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java b/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java
index f162edc..106f1af 100644
--- a/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java
+++ b/tests/appsecurity-tests/src/com/android/cts/appsecurity/AppSecurityTests.java
@@ -323,7 +323,7 @@
         private boolean mAllTestsPassed = true;
         private String mTestRunErrorMessage = null;
 
-        public void testEnded(TestIdentifier test,  Map<String, String> metrics) {
+        public void testEnded(TestIdentifier test, Map<String, String> metrics) {
             // ignore
         }
 
diff --git a/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java b/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java
index c67002c..c47b65b 100644
--- a/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java
+++ b/tests/tests/database/src/android/database/cts/DatabaseUtilsTest.java
@@ -50,6 +50,7 @@
         "age",             // 2
         "address"          // 3
     };
+    private static final String TABLE_NAME = "test";
 
     @Override
     protected void setUp() throws Exception {
@@ -61,7 +62,7 @@
         }
         mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null);
         assertNotNull(mDatabase);
-        mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " +
+        mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (_id INTEGER PRIMARY KEY, " +
                 "name TEXT, age INTEGER, address TEXT);");
     }
 
@@ -132,11 +133,12 @@
         String address = "LA";
 
         // at the beginning, there are no records in the database.
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
         assertEquals(0, cursor.getCount());
 
-        String sql = "INSERT INTO test (name, age, address) VALUES (?, ?, ?);";
+        String sql = "INSERT INTO " + TABLE_NAME + " (name, age, address) VALUES (?, ?, ?);";
         SQLiteStatement statement = mDatabase.compileStatement(sql);
         DatabaseUtils.bindObjectToProgram(statement, 1, name);
         DatabaseUtils.bindObjectToProgram(statement, 2, age);
@@ -144,7 +146,7 @@
         statement.execute();
         statement.close();
 
-        cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null);
         assertNotNull(cursor);
         assertEquals(1, cursor.getCount());
         cursor.moveToFirst();
@@ -161,8 +163,8 @@
     )
     public void testCreateDbFromSqlStatements() {
         String dbName = "ExampleName";
-        String sqls = "CREATE TABLE test (_id INTEGER PRIMARY KEY, name TEXT);\n"
-                + "INSERT INTO test (name) VALUES ('Mike');\n";
+        String sqls = "CREATE TABLE " + TABLE_NAME + " (_id INTEGER PRIMARY KEY, name TEXT);\n"
+                + "INSERT INTO " + TABLE_NAME + " (name) VALUES ('Mike');\n";
         DatabaseUtils.createDbFromSqlStatements(getContext(), dbName, 1, sqls);
 
         SQLiteDatabase db = getContext().openOrCreateDatabase(dbName, 0, null);
@@ -170,7 +172,7 @@
             "_id",             // 0
             "name"             // 1
         };
-        Cursor cursor = db.query("test", PROJECTION, null, null, null, null, null);
+        Cursor cursor = db.query(TABLE_NAME, PROJECTION, null, null, null, null, null);
         assertNotNull(cursor);
         assertEquals(1, cursor.getCount());
         cursor.moveToFirst();
@@ -185,8 +187,10 @@
                 android.content.ContentValues.class, java.lang.String.class}
     )
     public void testCursorDoubleToContentValues() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
 
         ContentValues contentValues = new ContentValues();
@@ -210,8 +214,10 @@
     )
     @ToBeFixed(bug = "1586458", explanation = "It's probably a typo.")
     public void testCursorDoubleToCursorValues() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
 
         ContentValues contentValues = new ContentValues();
@@ -241,8 +247,9 @@
         )
     })
     public void testCursorIntToContentValues() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null);
         assertNotNull(cursor);
 
         ContentValues contentValues = new ContentValues();
@@ -283,8 +290,9 @@
         )
     })
     public void testcursorLongToContentValues() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null);
         assertNotNull(cursor);
 
         ContentValues contentValues = new ContentValues();
@@ -316,8 +324,10 @@
         args = {android.database.Cursor.class, android.content.ContentValues.class}
     )
     public void testCursorRowToContentValues() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
 
         ContentValues contentValues = new ContentValues();
@@ -343,8 +353,10 @@
         )
     })
     public void testCursorStringToContentValues() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
 
         ContentValues contentValues = new ContentValues();
@@ -390,7 +402,8 @@
         mDatabase.execSQL("CREATE TABLE test_copy (_id INTEGER PRIMARY KEY, " +
                 "name TEXT, age INTEGER, address TEXT);");
 
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
         Cursor cursor = mDatabase.query("test_copy", TEST_PROJECTION, null, null, null, null, null);
         assertEquals(0, cursor.getCount());
 
@@ -399,7 +412,7 @@
         int indexAge = insertHelper.getColumnIndex("age");
         int indexAddress = insertHelper.getColumnIndex("address");
 
-        cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null);
         cursor.moveToNext();
         insertHelper.prepareForInsert();
         DatabaseUtils.cursorStringToInsertHelper(cursor, "name", insertHelper, indexName);
@@ -438,8 +451,10 @@
         )
     })
     public void testDumpCurrentRow() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
         cursor.moveToNext();
         String expected = "0 {\n   _id=1\n   name=Mike\n   age=20\n   address=LA\n}\n";
@@ -483,9 +498,12 @@
         )
     })
     public void testDumpCursor() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jack', '30', 'London');");
-        Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null);
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Jack', '30', 'London');");
+        Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION,
+                null, null, null, null, null);
         assertNotNull(cursor);
         int pos = cursor.getPosition();
         String expected = ">>>>> Dumping cursor " + cursor + "\n" +
@@ -564,13 +582,15 @@
         )
     })
     public void testLongForQuery() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
 
-        String query = "SELECT age FROM test";
+        String query = "SELECT age FROM " + TABLE_NAME;
         assertEquals(20, DatabaseUtils.longForQuery(mDatabase, query, null));
 
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jack', '35', 'London');");
-        query = "SELECT age FROM test WHERE name = ?";
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Jack', '35', 'London');");
+        query = "SELECT age FROM " + TABLE_NAME + " WHERE name = ?";
         String[] args = new String[] { "Jack" };
         assertEquals(35, DatabaseUtils.longForQuery(mDatabase, query, args));
         args = new String[] { "No such name" };
@@ -581,11 +601,11 @@
             // expected
         }
 
-        query = "SELECT count(*) FROM test;";
+        query = "SELECT count(*) FROM " + TABLE_NAME + ";";
         SQLiteStatement statement = mDatabase.compileStatement(query);
         assertEquals(2, DatabaseUtils.longForQuery(statement, null));
 
-        query = "SELECT age FROM test WHERE address = ?;";
+        query = "SELECT age FROM " + TABLE_NAME + " WHERE address = ?;";
         statement = mDatabase.compileStatement(query);
         args = new String[] { "London" };
         assertEquals(35, DatabaseUtils.longForQuery(statement, args));
@@ -600,19 +620,47 @@
         statement.close();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "queryNumEntries",
-        args = {android.database.sqlite.SQLiteDatabase.class, java.lang.String.class}
-    )
+    @TestTargets({
+        @TestTargetNew(
+            level = TestLevel.COMPLETE,
+            method = "queryNumEntries",
+            args = {android.database.sqlite.SQLiteDatabase.class, java.lang.String.class}
+        ),
+        @TestTargetNew(
+            level = TestLevel.COMPLETE,
+            method = "queryNumEntries",
+            args = {android.database.sqlite.SQLiteDatabase.class, java.lang.String.class,
+                    java.lang.String.class}
+        ),
+        @TestTargetNew(
+            level = TestLevel.COMPLETE,
+            method = "queryNumEntries",
+            args = {android.database.sqlite.SQLiteDatabase.class, java.lang.String.class,
+                    java.lang.String.class, java.lang.String[].class}
+        )
+    })
     public void testQueryNumEntries() {
-        assertEquals(0, DatabaseUtils.queryNumEntries(mDatabase, "test"));
+        assertEquals(0, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME));
 
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        assertEquals(1, DatabaseUtils.queryNumEntries(mDatabase, "test"));
+        mDatabase.execSQL(
+                "INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
+        assertEquals(1, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME));
 
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
-        assertEquals(2, DatabaseUtils.queryNumEntries(mDatabase, "test"));
+        mDatabase.execSQL(
+                "INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Susan', '20', 'AR');");
+        assertEquals(2, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME));
+
+        mDatabase.execSQL(
+                "INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Christian', '25', 'AT');");
+        assertEquals(3, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME));
+
+        assertEquals(2, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME, "AGE = 20"));
+
+        assertEquals(1, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME, "AGE = ?",
+                new String[] { "25" }));
 
         try {
             DatabaseUtils.queryNumEntries(mDatabase, "NoSuchTable");
@@ -695,13 +743,15 @@
         )
     })
     public void testStringForQuery() {
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');");
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Mike', '20', 'LA');");
 
-        String query = "SELECT name FROM test";
+        String query = "SELECT name FROM " + TABLE_NAME;
         assertEquals("Mike", DatabaseUtils.stringForQuery(mDatabase, query, null));
 
-        mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jack', '35', 'London');");
-        query = "SELECT name FROM test WHERE address = ?";
+        mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" +
+                " VALUES ('Jack', '35', 'London');");
+        query = "SELECT name FROM " + TABLE_NAME + " WHERE address = ?";
         String[] args = new String[] { "London" };
         assertEquals("Jack", DatabaseUtils.stringForQuery(mDatabase, query, args));
         args = new String[] { "No such address" };
@@ -712,7 +762,7 @@
             // expected
         }
 
-        query = "SELECT name FROM test WHERE age = ?;";
+        query = "SELECT name FROM " + TABLE_NAME + " WHERE age = ?;";
         SQLiteStatement statement = mDatabase.compileStatement(query);
         args = new String[] { "20" };
         assertEquals("Mike", DatabaseUtils.stringForQuery(statement, args));
@@ -726,4 +776,4 @@
         }
         statement.close();
     }
-}
+}
\ No newline at end of file
diff --git a/tests/tests/widget/src/android/widget/cts/ArrayAdapterTest.java b/tests/tests/widget/src/android/widget/cts/ArrayAdapterTest.java
index a268cba..4541e9d 100644
--- a/tests/tests/widget/src/android/widget/cts/ArrayAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/ArrayAdapterTest.java
@@ -526,6 +526,94 @@
         assertEquals(2, mockDataSetObserver.getCalledOnChangedCount());
     }
 
+    /**
+     * insert multiple items via add, notify data changed
+     * check count and content
+     */
+    @TestTargets({
+        @TestTargetNew(
+            level = TestLevel.COMPLETE,
+            method = "add",
+            args = {Object.class}
+        )
+    })
+    public void testAdd() {
+        mArrayAdapter.setNotifyOnChange(true);
+        final MockDataSetObserver mockDataSetObserver = new MockDataSetObserver();
+        mArrayAdapter.registerDataSetObserver(mockDataSetObserver);
+
+        mArrayAdapter.clear();
+        assertEquals(mArrayAdapter.getCount(), 0);
+
+        mArrayAdapter.add("testing");
+        mArrayAdapter.add("android");
+        assertEquals(mArrayAdapter.getCount(), 2);
+        assertEquals(mArrayAdapter.getItem(0), "testing");
+        assertEquals(mArrayAdapter.getItem(1), "android");
+    }
+
+    /**
+     * insert multiple items via addAll, notify data changed
+     * check count and content
+     */
+    @TestTargets({
+        @TestTargetNew(
+            level = TestLevel.COMPLETE,
+            method = "addAll",
+            args = {java.util.Collection.class}
+        )
+    })
+    public void testAddAllCollection() {
+        mArrayAdapter.setNotifyOnChange(true);
+        final MockDataSetObserver mockDataSetObserver = new MockDataSetObserver();
+        mArrayAdapter.registerDataSetObserver(mockDataSetObserver);
+
+        List<String> list = new ArrayList<String>();
+        list.add("");
+        list.add("hello");
+        list.add("android");
+        list.add("!");
+
+        mArrayAdapter.clear();
+        assertEquals(mArrayAdapter.getCount(), 0);
+
+        mArrayAdapter.addAll(list);
+        assertEquals(mArrayAdapter.getCount(), list.size());
+
+        assertEquals(mArrayAdapter.getItem(0), list.get(0));
+        assertEquals(mArrayAdapter.getItem(1), list.get(1));
+        assertEquals(mArrayAdapter.getItem(2), list.get(2));
+        assertEquals(mArrayAdapter.getItem(3), list.get(3));
+    }
+
+    /**
+     * insert multiple items via addAll, notify data changed
+     * check count and content
+     */
+    @TestTargets({
+        @TestTargetNew(
+            level = TestLevel.COMPLETE,
+            method = "addAll",
+            args = {Object[].class}
+        )
+    })
+    public void testAddAllParams() {
+        mArrayAdapter.setNotifyOnChange(true);
+        final MockDataSetObserver mockDataSetObserver = new MockDataSetObserver();
+        mArrayAdapter.registerDataSetObserver(mockDataSetObserver);
+
+        mArrayAdapter.clear();
+        assertEquals(mArrayAdapter.getCount(), 0);
+
+        mArrayAdapter.addAll("this", "is", "a", "unit", "test");
+        assertEquals(mArrayAdapter.getCount(), 5);
+        assertEquals(mArrayAdapter.getItem(0), "this");
+        assertEquals(mArrayAdapter.getItem(1), "is");
+        assertEquals(mArrayAdapter.getItem(2), "a");
+        assertEquals(mArrayAdapter.getItem(3), "unit");
+        assertEquals(mArrayAdapter.getItem(4), "test");
+    }
+
     private static class MockDataSetObserver extends DataSetObserver {
 
         private int mCalledOnChangedCount;
