RemoteTable extends BaseReadWriteTable<K, V> implements ReadWriteTable<K, V>, AsyncReadWriteTable<K, V> { @Override public void init(Context context) { super.init(context); asyncTable.init(context); if (readFn != null) { readFn.init(context, this); } if (writeFn != null) { writeFn.init(context, this); } } RemoteTable(
      String tableId,
      TableReadFunction readFn,
      TableWriteFunction writeFn,
      TableRateLimiter<K, V> readRateLimiter,
      TableRateLimiter<K, V> writeRateLimiter,
      ExecutorService rateLimitingExecutor,
      TableRetryPolicy readRetryPolicy,
      TableRetryPolicy writeRetryPolicy,
      ScheduledExecutorService retryExecutor,
      BatchProvider<K, V> batchProvider,
      ScheduledExecutorService batchExecutor,
      ExecutorService callbackExecutor); @Override V get(K key, Object ... args); @Override CompletableFuture<V> getAsync(K key, Object ... args); @Override Map<K, V> getAll(List<K> keys, Object ... args); @Override CompletableFuture<Map<K, V>> getAllAsync(List<K> keys, Object ... args); @Override T read(int opId, Object ... args); @Override CompletableFuture<T> readAsync(int opId, Object ... args); @Override void put(K key, V value, Object ... args); @Override CompletableFuture<Void> putAsync(K key, V value, Object ... args); @Override void putAll(List<Entry<K, V>> entries, Object ... args); @Override CompletableFuture<Void> putAllAsync(List<Entry<K, V>> records, Object ... args); @Override void delete(K key, Object ... args); @Override CompletableFuture<Void> deleteAsync(K key, Object ... args); @Override void deleteAll(List<K> keys, Object ... args); @Override CompletableFuture<Void> deleteAllAsync(List<K> keys, Object ... args); @Override T write(int opId, Object ... args); @Override CompletableFuture<T> writeAsync(int opId, Object... args); @Override void init(Context context); @Override void flush(); @Override void close(); TableReadFunction<K, V> getReadFunction(); TableWriteFunction<K, V> getWriteFunction();  }
@Test public void testInit() { String tableId = "testInit"; TableReadFunction<String, String> readFn = mock(TableReadFunction.class); TableWriteFunction<String, String> writeFn = mock(TableWriteFunction.class); RemoteTable<String, String> table = getTable(tableId, readFn, writeFn, true); AsyncReadWriteTable innerTable = TestUtils.getFieldValue(table, "asyncTable"); Assert.assertTrue(innerTable instanceof AsyncRetriableTable); Assert.assertNotNull(TestUtils.getFieldValue(innerTable, "readRetryMetrics")); Assert.assertNotNull(TestUtils.getFieldValue(innerTable, "writeRetryMetrics")); innerTable = TestUtils.getFieldValue(innerTable, "table"); Assert.assertTrue(innerTable instanceof AsyncRateLimitedTable); innerTable = TestUtils.getFieldValue(innerTable, "table"); Assert.assertTrue(innerTable instanceof AsyncRemoteTable); verify(readFn, times(1)).init(any(), any()); verify(writeFn, times(1)).init(any(), any()); }