public static Result getMetaTableRowResult(RegionInfo region, final ServerName sn,
    RegionInfo splita, RegionInfo splitb) throws IOException {
    List<Cell> kvs = new ArrayList<>();
    if (region != null) {
      kvs.add(new KeyValue(region.getRegionName(), HConstants.CATALOG_FAMILY,
        HConstants.REGIONINFO_QUALIFIER, RegionInfo.toByteArray(region)));
    }

    if (sn != null) {
      kvs.add(new KeyValue(region.getRegionName(), HConstants.CATALOG_FAMILY,
        HConstants.SERVER_QUALIFIER, Bytes.toBytes(sn.getAddress().toString())));
      kvs.add(new KeyValue(region.getRegionName(), HConstants.CATALOG_FAMILY,
        HConstants.STARTCODE_QUALIFIER, Bytes.toBytes(sn.getStartcode())));
    }

    if (splita != null) {
      kvs.add(new KeyValue(region.getRegionName(), HConstants.CATALOG_FAMILY,
        HConstants.SPLITA_QUALIFIER, RegionInfo.toByteArray(splita)));
    }

    if (splitb != null) {
      kvs.add(new KeyValue(region.getRegionName(), HConstants.CATALOG_FAMILY,
        HConstants.SPLITB_QUALIFIER, RegionInfo.toByteArray(splitb)));
    }

    // important: sort the kvs so that binary search work
    Collections.sort(kvs, MetaCellComparator.META_COMPARATOR);

    return Result.create(kvs);
  }
Returns a Result object constructed from the given region information simulating a catalog
table result.
@param region the RegionInfo object or null
@param sn     to use making startcode and server hostname:port in meta or null
@param splita daughter region or null
@param splitb daughter region or null
@return A mocked up Result that fakes a Get on a row in the <code>hbase:meta</code> table.
hbase-server/src/test/java/org/apache/hadoop/hbase/MetaMockingUtil.java