code: public static int checkAsyncBackupCount(int currentBackupCount, int newAsyncBackupCount) {
          if (currentBackupCount < 0) {
              throw new IllegalArgumentException("backup-count can't be smaller than 0");
          }
  
          if (newAsyncBackupCount < 0) {
              throw new IllegalArgumentException("async-backup-count can't be smaller than 0");
          }
  
          if (newAsyncBackupCount > MAX_BACKUP_COUNT) {
              throw new IllegalArgumentException("async-backup-count can't be larger than than " + MAX_BACKUP_COUNT);
          }
  
          if (currentBackupCount + newAsyncBackupCount > MAX_BACKUP_COUNT) {
              throw new IllegalArgumentException("the sum of backup-count and async-backup-count can't be larger than than "
                      + MAX_BACKUP_COUNT);
          }
  
          return newAsyncBackupCount;
      }
docs: Tests if the newAsyncBackupCount count is valid.
  
  @param currentBackupCount  the current number of backups
  @param newAsyncBackupCount the new number of async backups
  @return the newAsyncBackupCount
  @throws java.lang.IllegalArgumentException if asyncBackupCount is smaller than 0, or larger than the maximum
  number of backups.