@Test
  public void testEnsureTemporaryDirectoryTransfer() throws Exception {
    Admin admin = UTIL.getAdmin();
    TableName tableName2 = TableName.valueOf("testListTableSnapshots");
    try {
      TableDescriptor htd = TableDescriptorBuilder.newBuilder(tableName2).build();
      UTIL.createTable(htd, new byte[][] { TEST_FAM }, UTIL.getConfiguration());

      String table1Snapshot1 = "Table1Snapshot1";
      takeSnapshot(TABLE_NAME, table1Snapshot1, false);
      LOG.debug("Snapshot1 completed.");

      String table1Snapshot2 = "Table1Snapshot2";
      takeSnapshot(TABLE_NAME, table1Snapshot2, false);
      LOG.debug("Snapshot2 completed.");

      String table2Snapshot1 = "Table2Snapshot1";
      takeSnapshot(TABLE_NAME, table2Snapshot1, false);
      LOG.debug("Table2Snapshot1 completed.");

      List<SnapshotDescription> listTableSnapshots =
        admin.listTableSnapshots(Pattern.compile("test.*"), Pattern.compile(".*"));
      List<String> listTableSnapshotNames = new ArrayList<String>();
      assertEquals(3, listTableSnapshots.size());
      for (SnapshotDescription s : listTableSnapshots) {
        listTableSnapshotNames.add(s.getName());
      }
      assertTrue(listTableSnapshotNames.contains(table1Snapshot1));
      assertTrue(listTableSnapshotNames.contains(table1Snapshot2));
      assertTrue(listTableSnapshotNames.contains(table2Snapshot1));
    } finally {
      try {
        admin.deleteSnapshots(Pattern.compile("Table.*"));
      } catch (SnapshotDoesNotExistException ignore) {
      }
      if (admin.tableExists(tableName2)) {
        UTIL.deleteTable(tableName2);
      }
      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