WaterfallCache implements Cache { @Override public Observable<Boolean> remove(final String key) { if (memoryCache != null) { memoryCache.remove(key); } return doOnAll(cache -> cache.remove(key)); } private  WaterfallCache(List<RxCache> caches, Scheduler observeOnScheduler, int inlineMemoryCacheSize); @Override Observable<T> get(final String key, final Type typeOfT); @Override Observable<Boolean> put(final String key, final Object object); @Override Observable<Boolean> contains(final String key); @Override Observable<Boolean> remove(final String key); @Override Observable<Boolean> clear(); @Override void getAsync(String key, Type typeOfT, WaterfallGetCallback<T> callback); @Override void putAsync(String key, Object object, WaterfallCallback callback); @Override void containsAsync(String key, WaterfallGetCallback<Boolean> callback); @Override void removeAsync(String key, WaterfallCallback callback); @Override void clearAsync(WaterfallCallback callback); void setObserveOnScheduler(Scheduler scheduler); static Builder builder();  }
@Test public void testRemove() throws Exception { String key = "TEST_KEY"; when(cache1.remove(eq(key))).thenReturn(Observable.just(true)); when(cache2.remove(eq(key))).thenReturn(Observable.just(true)); ObservableTestUtils.testObservable(waterfallCache.remove(key), Assert::assertTrue); verify(cache1).remove(eq(key)); verify(cache2).remove(eq(key)); }