private byte[] findRow(final Region mr, final char table, final int rowToFind, final int answer)
    throws IOException {
    TableName tableb = TableName.valueOf("" + table);
    // Find the row.
    byte[] tofindBytes = Bytes.toBytes((short) rowToFind);
    byte[] metaKey = RegionInfo.createRegionName(tableb, tofindBytes, HConstants.NINES, false);
    LOG.info("find=" + new String(metaKey, StandardCharsets.UTF_8));
    Result r = UTIL.getClosestRowBefore(mr, metaKey, HConstants.CATALOG_FAMILY);
    if (answer == -1) {
      assertNull(r);
      return null;
    }
    assertTrue(
      Bytes.compareTo(Bytes.toBytes((short) answer), extractRowFromMetaRow(r.getRow())) == 0);
    return r.getRow();
  }
@param answer Pass -1 if we're not to find anything.
@return Row found.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java