private void putDataAndVerify(Table table, String row, byte[] family, String value, int verifyNum)
    throws IOException {
    System.out.println("=========Putting data :" + row);
    Put put = new Put(Bytes.toBytes(row));
    put.addColumn(family, Bytes.toBytes("q1"), Bytes.toBytes(value));
    table.put(put);
    ResultScanner resultScanner = table.getScanner(new Scan());
    List<Result> results = new ArrayList<>();
    while (true) {
      Result r = resultScanner.next();
      if (r == null) break;
      results.add(r);
    }
    resultScanner.close();
    if (results.size() != verifyNum) {
      System.out.println(results);
    }
    assertEquals(verifyNum, results.size());
  }
Tests that need to spin up a cluster testing an {@link HRegion}. Use {@link TestHRegion} if you
don't need a cluster, if you can test w/ a standalone {@link HRegion}.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java