@Test
  public void testContinuousSplitUsingLinkFile() throws Exception {
    final TableName tableName = TableName.valueOf(name.getMethodName());
    // Create table then get the single region for our new table.
    byte[] cf = Bytes.toBytes("cf");
    TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName)
      .setColumnFamily(ColumnFamilyDescriptorBuilder.of(cf));
    String splitPolicy = ConstantSizeRegionSplitPolicy.class.getName();
    builder.setValue(SPLIT_POLICY, splitPolicy);

    admin.createTable(builder.build());
    admin.compactionSwitch(false, new ArrayList<>());

    assertNotEquals("Unable to retrieve regions of the table", -1,
      TESTING_UTIL.waitFor(10000, () -> cluster.getRegions(tableName).size() == 1));
    Table table = TESTING_UTIL.getConnection().getTable(tableName);
    // insert data
    insertData(tableName, admin, table, 10);
    insertData(tableName, admin, table, 20);
    insertData(tableName, admin, table, 40);
    int rowCount = 3 * 4;
    Scan scan = new Scan();
    scanValidate(scan, rowCount, table);

    // Split
    admin.splitRegionAsync(cluster.getRegions(tableName).get(0).getRegionInfo().getRegionName(),
      Bytes.toBytes("row14"));
    // wait for the split to complete or get interrupted. If the split completes successfully,
    // the procedure will return true; if the split fails, the procedure would throw exception.
    Thread.sleep(3000);
    assertNotEquals("Table is not split properly?", -1,
      TESTING_UTIL.waitFor(3000, () -> cluster.getRegions(tableName).size() == 2));
    // we have 2 daughter regions
    HRegion hRegion1 = cluster.getRegions(tableName).get(0);
    HRegion hRegion2 = cluster.getRegions(tableName).get(1);
    HStore hStore1 = hRegion1.getStore(cf);
    HStore hStore2 = hRegion2.getStore(cf);
    // the sum of store files of the two children should be equal to their parent
    assertEquals(3, hStore1.getStorefilesCount() + hStore2.getStorefilesCount());
    // both the two children should have link files
    for (StoreFile sf : hStore1.getStorefiles()) {
      assertTrue(HFileLink.isHFileLink(sf.getPath()));
    }
    for (StoreFile sf : hStore2.getStorefiles()) {
      assertTrue(HFileLink.isHFileLink(sf.getPath()));
    }
    // validate children data
    scan = new Scan();
    scanValidate(scan, rowCount, table);

    // Continuous Split
    findRegionToSplit(tableName, "row24");
    Thread.sleep(3000);
    assertNotEquals("Table is not split properly?", -1,
      TESTING_UTIL.waitFor(3000, () -> cluster.getRegions(tableName).size() == 3));
    // now table has 3 region, each region should have one link file
    for (HRegion newRegion : cluster.getRegions(tableName)) {
      assertEquals(1, newRegion.getStore(cf).getStorefilesCount());
      assertTrue(
        HFileLink.isHFileLink(newRegion.getStore(cf).getStorefiles().iterator().next().getPath()));
    }

    scan = new Scan();
    scanValidate(scan, rowCount, table);

    // Continuous Split, random split HFileLink, generate Reference files.
    // After this, can not continuous split, because there are reference files.
    findRegionToSplit(tableName, "row11");
    Thread.sleep(3000);
    assertNotEquals("Table is not split properly?", -1,
      TESTING_UTIL.waitFor(3000, () -> cluster.getRegions(tableName).size() == 4));

    scan = new Scan();
    scanValidate(scan, rowCount, table);
  }
The below tests are testing split region against a running cluster
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java