public static int countMobRows(final Table table, final byte[]... families) throws IOException {
    Scan scan = new Scan();
    for (byte[] family : families) {
      scan.addFamily(family);
    }
    try (ResultScanner results = table.getScanner(scan)) {
      int count = 0;
      for (Result res; (res = results.next()) != null;) {
        count++;
        for (Cell cell : res.listCells()) {
          // Verify the value
          Assert.assertTrue(CellUtil.cloneValue(cell).length > 0);
        }
      }
      return count;
    }
  }
Return the number of rows in the given table.
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/MobSnapshotTestingUtils.java