public void assertRegionOnlyOnServer(final RegionInfo hri, final ServerName server,
    final long timeout) throws IOException, InterruptedException {
    long timeoutTime = EnvironmentEdgeManager.currentTime() + timeout;
    while (true) {
      List<RegionInfo> regions = getAdmin().getRegions(server);
      if (regions.stream().anyMatch(r -> RegionInfo.COMPARATOR.compare(r, hri) == 0)) {
        List<JVMClusterUtil.RegionServerThread> rsThreads =
          getHBaseCluster().getLiveRegionServerThreads();
        for (JVMClusterUtil.RegionServerThread rsThread : rsThreads) {
          HRegionServer rs = rsThread.getRegionServer();
          if (server.equals(rs.getServerName())) {
            continue;
          }
          Collection<HRegion> hrs = rs.getOnlineRegionsLocalContext();
          for (HRegion r : hrs) {
            if (r.getRegionInfo().getRegionId() == hri.getRegionId()) {
              throw new AssertionError("Region should not be double assigned");
            }
          }
        }
        return; // good, we are happy
      }
      long now = EnvironmentEdgeManager.currentTime();
      if (now > timeoutTime) break;
      Thread.sleep(10);
    }
    throw new AssertionError(
      "Could not find region " + hri.getRegionNameAsString() + " on server " + server);
  }
Check to make sure the region is open on the specified region server, but not on any other one.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java