@Test public void testPut() throws Exception { String key = "TEST_KEY"; String value = "TEST_VALUE"; SimpleObject object = new SimpleObject(value); when(cache1.put(eq(key), eq(object))).thenReturn(Observable.just(true)); when(cache2.put(eq(key), eq(object))).thenReturn(Observable.just(true)); ObservableTestUtils.testObservable(waterfallCache.put(key, object), Assert::assertTrue); verify(cache1).put(eq(key), eq(object)); verify(cache2).put(eq(key), eq(object)); }
@Override public Observable<Boolean> put(final String key, final Object object) { if (memoryCache != null) { memoryCache.put(key, object); } return doOnAll(cache -> cache.put(key, object)); }
WaterfallCache implements Cache { @Override public Observable<Boolean> put(final String key, final Object object) { if (memoryCache != null) { memoryCache.put(key, object); } return doOnAll(cache -> cache.put(key, object)); } }
WaterfallCache implements Cache { @Override public Observable<Boolean> put(final String key, final Object object) { if (memoryCache != null) { memoryCache.put(key, object); } return doOnAll(cache -> cache.put(key, object)); } private  WaterfallCache(List<RxCache> caches, Scheduler observeOnScheduler, int inlineMemoryCacheSize); }
WaterfallCache implements Cache { @Override public Observable<Boolean> put(final String key, final Object object) { if (memoryCache != null) { memoryCache.put(key, object); } return doOnAll(cache -> cache.put(key, object)); } 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(); }
WaterfallCache implements Cache { @Override public Observable<Boolean> put(final String key, final Object object) { if (memoryCache != null) { memoryCache.put(key, object); } return doOnAll(cache -> cache.put(key, object)); } 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();  }