FileStoreImpl implements FileStore { @Override public File getExternalCacheDir() { if (isExternalStorageAvailable()) { return prepare(context.getExternalCacheDir()); } return prepare(null); } FileStoreImpl(Context context); @Override File getCacheDir(); @Override File getExternalCacheDir(); @Override File getFilesDir(); @Override File getExternalFilesDir();  }
@Test public void testGetExternalCacheDir() { ShadowEnvironment.setExternalStorageState(Environment.MEDIA_MOUNTED); verifyFile(fileStore.getExternalCacheDir()); }
@Test public void testGetExternalCacheDir_withoutExternalStorage() { ShadowEnvironment.setExternalStorageState(Environment.MEDIA_REMOVED); assertNull(fileStore.getExternalCacheDir()); }