public static void confirmSnapshotValid(SnapshotProtos.SnapshotDescription snapshotDescriptor,
    TableName tableName, List<byte[]> nonEmptyTestFamilies, List<byte[]> emptyTestFamilies,
    Path rootDir, Admin admin, FileSystem fs) throws IOException {
    final Configuration conf = admin.getConfiguration();

    // check snapshot dir
    Path snapshotDir =
      SnapshotDescriptionUtils.getCompletedSnapshotDir(snapshotDescriptor, rootDir);
    assertTrue("target snapshot directory, '" + snapshotDir + "', doesn't exist.",
      fs.exists(snapshotDir));

    SnapshotProtos.SnapshotDescription desc =
      SnapshotDescriptionUtils.readSnapshotInfo(fs, snapshotDir);

    // Extract regions and families with store files
    final Set<byte[]> snapshotFamilies = new TreeSet<>(Bytes.BYTES_COMPARATOR);

    SnapshotManifest manifest = SnapshotManifest.open(conf, fs, snapshotDir, desc);
    Map<String, SnapshotRegionManifest> regionManifests = manifest.getRegionManifestsMap();
    for (SnapshotRegionManifest regionManifest : regionManifests.values()) {
      SnapshotReferenceUtil.visitRegionStoreFiles(regionManifest,
        new SnapshotReferenceUtil.StoreFileVisitor() {
          @Override
          public void storeFile(final RegionInfo regionInfo, final String family,
            final SnapshotRegionManifest.StoreFile storeFile) throws IOException {
            snapshotFamilies.add(Bytes.toBytes(family));
          }
        });
    }
    // Verify that there are store files in the specified families
    if (nonEmptyTestFamilies != null) {
      for (final byte[] familyName : nonEmptyTestFamilies) {
        assertTrue("Expected snapshot to contain family '" + Bytes.toString(familyName)
          + "', but it does not.", snapshotFamilies.contains(familyName));
      }
    }

    // Verify that there are no store files in the specified families
    if (emptyTestFamilies != null) {
      for (final byte[] familyName : emptyTestFamilies) {
        assertFalse("Expected snapshot to skip empty family '" + Bytes.toString(familyName)
          + "', but it is present.", snapshotFamilies.contains(familyName));
      }
    }

    // check the region snapshot for all the regions
    List<RegionInfo> regions = admin.getRegions(tableName);
    // remove the non-default regions
    RegionReplicaUtil.removeNonDefaultRegions(regions);
    boolean hasMob =
      regionManifests.containsKey(MobUtils.getMobRegionInfo(tableName).getEncodedName());
    if (hasMob) {
      assertEquals("Wrong number of regions.", regions.size(), regionManifests.size() - 1);
    } else {
      // if create snapshot when table splitting, parent region will be included to the snapshot
      // region manifest. we should exclude the parent regions.
      int regionCountExclusiveSplitParent = 0;
      for (SnapshotRegionManifest snapshotRegionManifest : regionManifests.values()) {
        RegionInfo hri = ProtobufUtil.toRegionInfo(snapshotRegionManifest.getRegionInfo());
        if (hri.isOffline() && (hri.isSplit() || hri.isSplitParent())) {
          continue;
        }
        regionCountExclusiveSplitParent++;
      }
      assertEquals("Wrong number of regions.", regions.size(), regionCountExclusiveSplitParent);
    }

    // Verify Regions (redundant check, see MasterSnapshotVerifier)
    for (RegionInfo info : regions) {
      String regionName = info.getEncodedName();
      assertTrue("Missing region name: '" + regionName + "'",
        regionManifests.containsKey(regionName));
    }
  }
Confirm that the snapshot contains references to all the files that should be in the snapshot.
This method also perform some redundant check like the existence of the snapshotinfo or the
regioninfo which are done always by the MasterSnapshotVerifier, at the end of the snapshot
operation.
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java