public static void assertArchiveEqualToOriginal(FileStatus[] expected, FileStatus[] actual,
    FileSystem fs, boolean hasTimedBackup) throws IOException {

    List<List<String>> lists = getFileLists(expected, actual);
    List<String> original = lists.get(0);
    Collections.sort(original);

    List<String> currentFiles = lists.get(1);
    Collections.sort(currentFiles);

    List<String> backedup = lists.get(2);
    Collections.sort(backedup);

    // check the backed up files versus the current (should match up, less the
    // backup time in the name)
    assertEquals("Didn't expect any backup files, but got: " + backedup, hasTimedBackup,
      backedup.size() > 0);
    String msg = null;
    if (hasTimedBackup) {
      assertArchiveEquality(original, backedup);
      assertNull(msg, msg);
    }

    // do the rest of the comparison
    msg = assertArchiveEquality(original, currentFiles);
    assertNull(msg, msg);
  }
Compare the archived files to the files in the original directory
@param expected       original files that should have been archived
@param actual         files that were archived
@param fs             {@link FileSystem} on which the archiving took place
@param hasTimedBackup <tt>true</tt> if we expect to find an archive backup directory with a
                      copy of the files in the archive directory (and the original files).
hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java