@Test
public void testSampleRowKeysAsync() throws Exception {

  final ByteString ROW_KEY_1 = ByteString.copyFromUtf8("row-key-1");
  final ByteString ROW_KEY_2 = ByteString.copyFromUtf8("row-key-2");
  final ByteString ROW_KEY_3 = ByteString.copyFromUtf8("row-key-3");
  String tableName = NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID);
  SampleRowKeysRequest requestProto =
      SampleRowKeysRequest.newBuilder().setTableName(tableName).build();
  List<SampleRowKeysResponse> responseProto =
      ImmutableList.of(
          SampleRowKeysResponse.newBuilder().setRowKey(ROW_KEY_1).setOffsetBytes(11).build(),
          SampleRowKeysResponse.newBuilder().setRowKey(ROW_KEY_2).setOffsetBytes(12).build(),
          SampleRowKeysResponse.newBuilder().setRowKey(ROW_KEY_3).setOffsetBytes(13).build());
  when(delegate.sampleRowKeysAsync(requestProto))
      .thenReturn(Futures.immediateFuture(responseProto));
  List<KeyOffset> keyOffsetList = dataClientWrapper.sampleRowKeysAsync(TABLE_ID).get();
  assertEquals(keyOffsetList.get(0).getKey(), ROW_KEY_1);
  assertEquals(keyOffsetList.get(1).getKey(), ROW_KEY_2);
  assertEquals(keyOffsetList.get(2).getKey(), ROW_KEY_3);
  verify(delegate).sampleRowKeysAsync(requestProto);
}