@Before
  public void setup() throws Exception {
    this.admin = TEST_UTIL.getAdmin();
    long tid = EnvironmentEdgeManager.currentTime();
    tableName = TableName.valueOf(getValidMethodName() + "-" + tid);
    emptySnapshot = "emptySnaptb-" + tid;
    snapshotName0 = "snaptb0-" + tid;
    snapshotName1 = "snaptb1-" + tid;
    snapshotName2 = "snaptb2-" + tid;

    // create Table and disable it
    createTable();
    admin.disableTable(tableName);

    // take an empty snapshot
    admin.snapshot(emptySnapshot, tableName);

    // enable table and insert data
    admin.enableTable(tableName);
    SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
    try (Table table = TEST_UTIL.getConnection().getTable(tableName)) {
      snapshot0Rows = countRows(table);
    }
    admin.disableTable(tableName);

    // take a snapshot
    admin.snapshot(snapshotName0, tableName);

    // enable table and insert more data
    admin.enableTable(tableName);
    SnapshotTestingUtils.loadData(TEST_UTIL, tableName, 500, FAMILY);
    try (Table table = TEST_UTIL.getConnection().getTable(tableName)) {
      snapshot1Rows = countRows(table);
    }
  }
Initialize the tests with a table filled with some data and two snapshots (snapshotName0,
snapshotName1) of different states. The tableName, snapshotNames and the number of rows in the
snapshot are initialized.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientTestBase.java