### Question:
SqliteUtil { public static ContentValues toContentValues(Map<String, Object> input) { if (input == null) { return null; } Parcel parcel = Parcel.obtain(); parcel.writeMap(input); parcel.setDataPosition(0); return ContentValues.CREATOR.createFromParcel(parcel); } private  SqliteUtil(); static void putIfNotNull(ContentValues values, String column,
            Object value); static Date loadDate(Cursor cursor, int index); static Boolean loadBoolean(Cursor cursor, int index); static Boolean toBoolean(Integer intValue); static ContentValues toContentValues(Map<String, Object> input); static Integer toInteger(Boolean boolValue); static Integer loadInteger(Cursor cursor, int index); static Long loadLong(Cursor cursor, int index); static final Integer FALSE; static final Integer TRUE; }### Answer:
@Test public void testToContentValues() { Map<String, Object> expected = new HashMap<String, Object>(); expected.put("key1", Integer.valueOf(42)); expected.put("KEY2", "value2"); ContentValues actual = SqliteUtil.toContentValues(expected); assertEquals("ContentValues contans unexpected amount of values", expected.size(), actual.keySet().size()); for (Entry<String, Object> expectedEntry : expected.entrySet()) { assertEquals("ContentValue returns different value for key " + expectedEntry.getKey(), expectedEntry.getValue(), actual.get(expectedEntry.getKey())); } }
@Test public void testToContentValuesNull() { assertNull(SqliteUtil.toContentValues(null)); }
@Test public void testToContentValuesEmpty() { ContentValues actual = SqliteUtil .toContentValues(new HashMap<String, Object>()); assertEquals("ContentValues contans unexpected amount of values", 0, actual.keySet().size()); }