public static <T> Long getMinValue(Map<T, Long> map) {
    Long minTimestamp = null;
    if (map != null) {
      ArrayList<Long> timestampList = new ArrayList<>(map.values());
      Collections.sort(timestampList);
      // The min among all the RS log timestamps will be kept in backup system table table.
      minTimestamp = timestampList.get(0);
    }
    return minTimestamp;
  }
Get the min value for all the Values a map.
@param map map
@return the min value
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java