@Test
  public void test() throws IOException, InterruptedException {
    try (Table table = TEST_UTIL.getConnection().getTable(TABLE_NAME)) {
      for (int i = 0; i < 100; i++) {
        table.put(new Put(Bytes.toBytes(i)).addColumn(FAMILY, QUALIFIER, VALUE));
      }
    }
    TEST_UTIL.getAdmin().split(TABLE_NAME, Bytes.toBytes(50));
    TEST_UTIL.waitFor(60000,
      () -> TEST_UTIL.getMiniHBaseCluster().getRegions(TABLE_NAME).size() == 2);
    // make sure we can access the split regions
    try (Table table = TEST_UTIL.getConnection().getTable(TABLE_NAME)) {
      for (int i = 0; i < 100; i++) {
        assertFalse(table.get(new Get(Bytes.toBytes(i))).isEmpty());
      }
    }
    // let's cache the two old locations
    AsyncTableRegionLocator locator = ASYNC_CONN.getRegionLocator(TABLE_NAME);
    locator.getRegionLocation(Bytes.toBytes(0)).join();
    locator.getRegionLocation(Bytes.toBytes(99)).join();
    // recreate the table
    TEST_UTIL.getAdmin().disableTable(TABLE_NAME);
    TEST_UTIL.getAdmin().deleteTable(TABLE_NAME);
    TEST_UTIL.createTable(TABLE_NAME, FAMILY);
    TEST_UTIL.waitTableAvailable(TABLE_NAME);
    // confirm that we can still get the correct location
    assertFalse(ASYNC_CONN.getTable(TABLE_NAME).exists(new Get(Bytes.toBytes(99))).join());
  }
Fix an infinite loop in {@link AsyncNonMetaRegionLocator}, see the comments on HBASE-21943 for
more details.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableLocateRegionForDeletedTable.java