@Test
public void testGetRegionLocation() throws ExecutionException, InterruptedException {

  List<KeyOffset> keyOffsets =
      ImmutableList.of(
          KeyOffset.create(ByteString.copyFromUtf8("a"), 100L),
          KeyOffset.create(ByteString.copyFromUtf8("b"), 100L),
          KeyOffset.create(ByteString.copyFromUtf8("y"), 100L),
          KeyOffset.create(ByteString.copyFromUtf8("z"), 100L));
  when(mockDataClient.sampleRowKeysAsync(TABLE_NAME.getNameAsString()))
      .thenReturn(ApiFutures.immediateFuture(keyOffsets));
  HRegionLocation regionLocationFuture =
      regionLocator.getRegionLocation(Bytes.toBytes("rowKey"), 1, false).get();
  assertEquals("b", Bytes.toString(regionLocationFuture.getRegion().getStartKey()));
  assertEquals("y", Bytes.toString(regionLocationFuture.getRegion().getEndKey()));
  assertEquals(TABLE_NAME, regionLocator.getName());
}