### Question:
AsyncStorageModule extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable { @ReactMethod public void clear(final Callback callback) { new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) { @Override protected void doInBackgroundGuarded(Void... params) { if (!mReactDatabaseSupplier.ensureDatabase()) { callback.invoke(AsyncStorageErrorUtil.getDBError(null)); return; } try { mReactDatabaseSupplier.clear(); callback.invoke(); } catch (Exception e) { FLog.w(ReactConstants.TAG, e.getMessage(), e); callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage())); } } }.executeOnExecutor(executor); } AsyncStorageModule(ReactApplicationContext reactContext); @VisibleForTesting  AsyncStorageModule(ReactApplicationContext reactContext, Executor executor); @Override String getName(); @Override void initialize(); @Override void onCatalystInstanceDestroy(); @Override void clearSensitiveData(); @ReactMethod void multiGet(final ReadableArray keys, final Callback callback); @ReactMethod void multiSet(final ReadableArray keyValueArray, final Callback callback); @ReactMethod void multiRemove(final ReadableArray keys, final Callback callback); @ReactMethod void multiMerge(final ReadableArray keyValueArray, final Callback callback); @ReactMethod void clear(final Callback callback); @ReactMethod void getAllKeys(final Callback callback);  }### Answer:
@Test public void testClear() { JavaOnlyArray keyValues = new JavaOnlyArray(); keyValues.pushArray(getArray("foo", "foo2")); keyValues.pushArray(getArray("bar", "bar2")); mStorage.multiSet(keyValues, mock(Callback.class)); Callback clearCallback2 = mock(Callback.class); mStorage.clear(clearCallback2); verify(clearCallback2, Mockito.times(1)).invoke(); Callback getAllCallback2 = mock(Callback.class); mStorage.getAllKeys(getAllCallback2); verify(getAllCallback2, Mockito.times(1)).invoke(null, mEmptyArray); }