public void checkNodeCount(int numSlaves) throws Exception {
    HBaseClusterInterface cluster = getHBaseClusterInterface();
    if (cluster.getClusterMetrics().getLiveServerMetrics().size() < numSlaves) {
      throw new Exception("Cluster does not have enough nodes:" + numSlaves);
    }
  }
Checks whether we have more than numSlaves nodes. Throws an exception otherwise.
hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java