public boolean ensureSomeNonStoppedRegionServersAvailable(final int num) throws IOException {
    boolean startedServer = ensureSomeRegionServersAvailable(num);

    int nonStoppedServers = 0;
    for (JVMClusterUtil.RegionServerThread rst : getMiniHBaseCluster().getRegionServerThreads()) {

      HRegionServer hrs = rst.getRegionServer();
      if (hrs.isStopping() || hrs.isStopped()) {
        LOG.info("A region server is stopped or stopping:" + hrs);
      } else {
        nonStoppedServers++;
      }
    }
    for (int i = nonStoppedServers; i < num; ++i) {
      LOG.info("Started new server=" + getMiniHBaseCluster().startRegionServer());
      startedServer = true;
    }
    return startedServer;
  }
Make sure that at least the specified number of region servers are running. We don't count the
ones that are currently stopping or are stopped.
@param num minimum number of region servers that should be running
@return true if we started some servers
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java