@Test
  public void testSnapshotCloneContents() throws Exception {
    // make sure we don't fail on listing snapshots
    SnapshotTestingUtils.assertNoSnapshots(admin);

    // put some stuff in the table
    Table table = UTIL.getConnection().getTable(TABLE_NAME);
    UTIL.loadTable(table, TEST_FAM);
    table.close();

    String snapshot1 = "TableSnapshot1";
    takeSnapshot(TABLE_NAME, snapshot1, false);
    LOG.debug("Snapshot1 completed.");

    TableName clone = TableName.valueOf("Table1Clone");
    admin.cloneSnapshot(snapshot1, clone, false);

    Scan original = new Scan();
    Scan cloned = new Scan();
    ResultScanner originalScan = admin.getConnection().getTable(TABLE_NAME).getScanner(original);
    ResultScanner clonedScan =
      admin.getConnection().getTable(TableName.valueOf("Table1Clone")).getScanner(cloned);

    Iterator<Result> i = originalScan.iterator();
    Iterator<Result> i2 = clonedScan.iterator();
    assertTrue(i.hasNext());
    while (i.hasNext()) {
      assertTrue(i2.hasNext());
      assertEquals(Bytes.toString(i.next().getValue(TEST_FAM, new byte[] {})),
        Bytes.toString(i2.next().getValue(TEST_FAM, new byte[] {})));
    }
    assertFalse(i2.hasNext());
    admin.deleteSnapshot(snapshot1);
    UTIL.deleteTable(clone);
    admin.close();
  }
Tests that snapshot has correct contents by taking snapshot, cloning it, then affirming the
contents of the original and cloned table match
@throws Exception if snapshot does not complete successfully
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotTemporaryDirectory.java