AsyncRemoteTable implements AsyncReadWriteTable<K, V> { @Override public CompletableFuture<Map<K, V>> getAllAsync(List<K> keys, Object ... args) { Preconditions.checkNotNull(readFn, "null readFn"); return args.length > 0 ? readFn.getAllAsync(keys, args) : readFn.getAllAsync(keys); } AsyncRemoteTable(TableReadFunction<K, V> readFn, TableWriteFunction<K, V> writeFn); @Override CompletableFuture<V> getAsync(K key, Object ... args); @Override CompletableFuture<Map<K, V>> getAllAsync(List<K> keys, Object ... args); @Override CompletableFuture<T> readAsync(int opId, Object... args); @Override CompletableFuture<Void> putAsync(K key, V record, Object... args); @Override CompletableFuture<Void> putAllAsync(List<Entry<K, V>> entries, Object ... args); @Override CompletableFuture<Void> deleteAsync(K key, Object... args); @Override CompletableFuture<Void> deleteAllAsync(List<K> keys, Object ... args); @Override CompletableFuture<T> writeAsync(int opId, Object... args); @Override void init(Context context); @Override void flush(); @Override void close();  }
@Test public void testGetAllAsync() { int times = 0; roTable.getAllAsync(Arrays.asList(1, 2)); verify(readFn, times(++times)).getAllAsync(any()); rwTable.getAllAsync(Arrays.asList(1, 2)); verify(readFn, times(++times)).getAllAsync(any()); }
@Test public void testGetAllAsyncWithArgs() { int times = 0; roTable.getAllAsync(Arrays.asList(1, 2), Arrays.asList(0, 0)); verify(readFn, times(++times)).getAllAsync(any(), any()); rwTable.getAllAsync(Arrays.asList(1, 2), Arrays.asList(0, 0)); verify(readFn, times(++times)).getAllAsync(any(), any()); }