AsyncRemoteTable implements AsyncReadWriteTable<K, V> { @Override public void close() { if (readFn != null) { readFn.close(); } if (writeFn != null) { writeFn.close(); } } 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 testClose() { roTable.close(); verify(readFn, times(1)).close(); verify(writeFn, times(0)).close(); rwTable.close(); verify(readFn, times(2)).close(); verify(writeFn, times(1)).close(); }