public static boolean compareArchiveToOriginal(FileStatus[] previous, FileStatus[] archived,
    FileSystem fs, boolean hasTimedBackup) {

    List<List<String>> lists = getFileLists(previous, archived);
    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)
    if (!hasTimedBackup == (backedup.size() > 0)) {
      LOG.debug("backedup files doesn't match expected.");
      return false;
    }
    String msg = null;
    if (hasTimedBackup) {
      msg = assertArchiveEquality(original, backedup);
      if (msg != null) {
        LOG.debug(msg);
        return false;
      }
    }
    msg = assertArchiveEquality(original, currentFiles);
    if (msg != null) {
      LOG.debug(msg);
      return false;
    }
    return true;
  }
Test helper for testing archiving of HFiles
hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java