TwitterContext extends ContextWrapper { @Override public File getDatabasePath(String name) { final File dir = new File(super.getDatabasePath(name).getParentFile(), componentPath); dir.mkdirs(); return new File(dir, name); } TwitterContext(Context base, String componentName, String componentPath); @Override File getDatabasePath(String name); @Override SQLiteDatabase openOrCreateDatabase(String name, int mode,
            SQLiteDatabase.CursorFactory factory); @Override SQLiteDatabase openOrCreateDatabase(String name, int mode,
            SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler); @Override File getFilesDir(); @Override File getExternalFilesDir(String type); @Override File getCacheDir(); @Override File getExternalCacheDir(); @Override SharedPreferences getSharedPreferences(String name, int mode);  }
@Test public void testGetDatabasePath() { final File file = context.getDatabasePath("a"); assertValidDirStructure(file); assertTrue(file.getParentFile().exists()); }