FutureCacheWrapper implements FutureCache<K, V> { @Override public Future<Collection<K>> removeAll(Collection<K> keys) { return future(config.delegate.removeAll(keys)); } private  FutureCacheWrapper(Builder<K, V> config); @Override Future<V> get(K key); @Override Future<V> put(K key, V value, long expiry, TimeUnit unit); @Override Future<K> remove(K key); @Override Future<Map<K, V>> getAll(Collection<K> keys); @Override Future<Map<K, V>> putAll(Map<K, V> map, long expiry, TimeUnit unit); @Override Future<Collection<K>> removeAll(Collection<K> keys); static Builder<K, V> newBuilder(Class<K> keyType, Class<V> valueType);  }
@Test public void testRemoveAll() throws ExecutionException, InterruptedException { final List<String> keys = new ArrayList<>(); keys.add("foo"); keys.add("bar"); keys.add("baz"); final Single<Collection<String>> single = Single.create(new Single.OnSubscribe<Collection<String>>() { @Override public void call(SingleSubscriber<? super Collection<String>> singleSubscriber) { singleSubscriber.onSuccess(keys); } }); when(delegate.removeAll(keys)).thenReturn(single); final Future<Collection<String>> foo = wrapper.removeAll(keys); final Collection<String> result = foo.get(); assertThat(result).isEqualTo(keys); }