@Test
public void testSampleRowKeys() {

  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();
  ImmutableList.Builder sampleKeys = ImmutableList.builder();
  sampleKeys.add(
      SampleRowKeysResponse.newBuilder().setRowKey(ROW_KEY_1).setOffsetBytes(11).build());
  sampleKeys.add(
      SampleRowKeysResponse.newBuilder().setRowKey(ROW_KEY_2).setOffsetBytes(12).build());
  sampleKeys.add(
      SampleRowKeysResponse.newBuilder().setRowKey(ROW_KEY_3).setOffsetBytes(13).build());
  when(client.sampleRowKeys(requestProto)).thenReturn(sampleKeys.build());
  List<KeyOffset> keyOffsetList = clientWrapper.sampleRowKeys(TABLE_ID);
  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(client).sampleRowKeys(requestProto);
}